Packet loss every 30.999 seconds

Bruce Evans brde at
Mon Dec 17 22:20:38 PST 2007

On Mon, 17 Dec 2007, David G Lawrence wrote:

>   One more comment on my last email... The patch that I included is not
> meant as a real fix - it is just a bandaid. The real problem appears to
> be that a very large number of vnodes (all of them?) are getting synced
> (i.e. calling ffs_syncvnode()) every time. This should normally only
> happen for dirty vnodes. I suspect that something is broken with this
> check:
>        if (vp->v_type == VNON || ((ip->i_flag &
>            (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
>             vp->v_bufobj.bo_dirty.bv_cnt == 0)) {
>                VI_UNLOCK(vp);
>                continue;
>        }

Isn't it just the O(N) algorithm with N quite large?  Under ~5.2, on
a 2.2GHz A64 UP in 32-bit mode, I see a latency of 3 ms for 17500 vnodes,
which would be explained by the above (and the VI_LOCK() and loop
overhead) taking 171 ns per vnode.  I would expect it to take more like
20 ns per vnode for UP and 60 for SMP.

The comment before this code shows that the problem is known, and says
that a subroutine call cannot be afforded unless there is work to do,
but the, the locking accesses look like subroutine calls, have subroutine
calls in their internals, and take longer than simple subroutine calls
in the SMP case even when they don't make subroutine calls.  (IIRC, on
A64 a minimal subroutine call takes 4 cycles while a minimal locked
instructions takes 18 cycles; subroutine calls are only slow when their
branches are mispredicted.)


More information about the freebsd-net mailing list