Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2007 01:28:31 -0500
From:      Mark Fullmer <maf@splintered.net>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-net@freebsd.org, freebsd-stable@freebsd.org
Subject:   Re: Packet loss every 30.999 seconds
Message-ID:  <3647BB78-BA10-432B-A52B-04E402E155CC@splintered.net>
In-Reply-To: <20071222053648.GQ57756@deviant.kiev.zoral.com.ua>
References:  <D50B5BA8-5A80-4370-8F20-6B3A531C2E9B@eng.oar.net> <20071217102433.GQ25053@tnn.dglawrence.com> <CD187AD1-8712-418F-9F49-FA3407BA1AC7@eng.oar.net> <20071220011626.U928@besplex.bde.org> <814DB7A9-E64F-4BCA-A502-AB5A6E0297D3@eng.oar.net> <20071219171331.GH25053@tnn.dglawrence.com> <20071221200810.GY16982@elvis.mu.org> <20071221234347.GS25053@tnn.dglawrence.com> <6D374B4C-0D98-4916-A762-7A85912B3058@splintered.net> <20071222053648.GQ57756@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

On Dec 22, 2007, at 12:36 AM, Kostik Belousov wrote:

> On Fri, Dec 21, 2007 at 10:30:51PM -0500, Mark Fullmer wrote:
>> The uio_yield() idea did not work.  Still have the same 31 second
>> interval packet loss.
> What patch you have used ?

This is hand applied from the diff you sent December 19, 2007 1:24:48  
PM EST

sr1400-ar0.eng:/usr/src/sys/ufs/ffs# diff -c ffs_vfsops.c  
ffs_vfsops.c.orig
*** ffs_vfsops.c        Fri Dec 21 21:08:39 2007
--- ffs_vfsops.c.orig   Sat Dec 22 00:51:22 2007
***************
*** 1107,1113 ****
         struct ufsmount *ump = VFSTOUFS(mp);
         struct fs *fs;
         int error, count, wait, lockreq, allerror = 0;
-       int yield_count;
         int suspend;
         int suspended;
         int secondary_writes;
--- 1107,1112 ----
***************
*** 1148,1154 ****
         softdep_get_depcounts(mp, &softdep_deps, &softdep_accdeps);
         MNT_ILOCK(mp);

-         yield_count = 0;
         MNT_VNODE_FOREACH(vp, mp, mvp) {
                 /*
                  * Depend on the mntvnode_slock to keep things  
stable enough
--- 1147,1152 ----
***************
*** 1166,1177 ****
                     (IN_ACCESS | IN_CHANGE | IN_MODIFIED |  
IN_UPDATE)) == 0 &&
                     vp->v_bufobj.bo_dirty.bv_cnt == 0)) {
                         VI_UNLOCK(vp);
-                       if (yield_count++ == 100) {
-                               MNT_IUNLOCK(mp);
-                               yield_count = 0;
-                               uio_yield();
-                               goto relock_mp;
-                       }
                         continue;
                 }
                 MNT_IUNLOCK(mp);
--- 1164,1169 ----
***************
*** 1186,1192 ****
                 if ((error = ffs_syncvnode(vp, waitfor)) != 0)
                         allerror = error;
                 vput(vp);
- relock_mp:
                 MNT_ILOCK(mp);
         }
         MNT_IUNLOCK(mp);
--- 1178,1183 ----



>
> Lets check whether the syncer is the culprit for you.
> Please, change the value of the syncdelay at the sys/kern/vfs_subr.c
> around the line 238 from 30 to some other value, e.g., 45. After that,
> check the interval of the effect you have observed.

Changed it to 13.  Not sure if SYNCER_MAXDELAY also needed to be
increased if syncdelay was increased.

static int syncdelay = 13;              /* max time to delay syncing  
data */

Test:

; use vnodes
% find / -type f -print > /dev/null

; verify
% sysctl vfs.numvnodes
vfs.numvnodes: 32128

; run packet loss test
now have periodic loss every 13994633us (13.99 seconds).

; reduce # of vnodes with sysctl kern.maxvnodes=1000
test now runs clean.

>
> It would be interesting to check whether completely disabling the  
> syncer
> eliminates the packet loss, but such system have to be operated with
> extreme caution.
>





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3647BB78-BA10-432B-A52B-04E402E155CC>