From owner-freebsd-net@FreeBSD.ORG Sat Dec 22 03:57:50 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31F1C16A417 for ; Sat, 22 Dec 2007 03:57:50 +0000 (UTC) (envelope-from maf@splintered.net) Received: from sv1.eng.oar.net (sv1.eng.oar.net [192.148.251.86]) by mx1.freebsd.org (Postfix) with SMTP id C47D013C448 for ; Sat, 22 Dec 2007 03:57:49 +0000 (UTC) (envelope-from maf@splintered.net) Received: (qmail 59559 invoked from network); 22 Dec 2007 03:31:09 -0000 Received: from dev1.eng.oar.net (HELO ?127.0.0.1?) (192.148.251.71) by sv1.eng.oar.net with SMTP; 22 Dec 2007 03:31:09 -0000 In-Reply-To: <20071221234347.GS25053@tnn.dglawrence.com> References: <20071217102433.GQ25053@tnn.dglawrence.com> <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> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6D374B4C-0D98-4916-A762-7A85912B3058@splintered.net> Content-Transfer-Encoding: 7bit From: Mark Fullmer Date: Fri, 21 Dec 2007 22:30:51 -0500 To: David G Lawrence X-Mailer: Apple Mail (2.752.3) Cc: freebsd-net@freebsd.org, Alfred Perlstein , freebsd-stable@freebsd.org Subject: Re: Packet loss every 30.999 seconds X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2007 03:57:50 -0000 The uio_yield() idea did not work. Still have the same 31 second interval packet loss. Is it safe to assume the vp will be valid after a msleep() or uio_yield()? If so can we do something a little different: Currently: /* this takes too long when list is large */ MNT_VNODE_FOREACH(vp, mp, mvp) { do work } Why not do this incrementally and call ffs_sync() more often, or break it out into ffs_isync() (incremental sync). static struct vnode *vp; /* first? */ if (!vp) vp = __mnt_vnode_first(&mvp, mp); for (vcount = 0; vp && (vcount != 500); ++vcount) { do work vp = __mnt_vnode_next(&mvp, mp); } The problem I see with this is a race condition where this list may change between the incremental calls. -- mark On Dec 21, 2007, at 6:43 PM, David G Lawrence wrote: >>> Unfortunately, the version of the patch that I sent out isn't >>> going to >>> help your problem. It needs to yield at the top of the loop, but >>> vp isn't >>> necessarily valid after the wakeup from the msleep. That's a >>> problem that >>> I'm having trouble figuring out a solution to - the solutions >>> that come >>> to mind will all significantly increase the overhead of the loop. >> >> I apologize for not reading the code as I am swamped, but a technique >> that Matt Dillon used for bufs might work here. >> >> Can you use a placeholder vnode as a place to restart the scan? >> you might have to mark it special so that other threads/things >> (getnewvnode()?) don't molest it, but it can provide for a convenient >> restart point. > > That was one of the solutions that I considered and rejected > since it > would significantly increase the overhead of the loop. > The solution provided by Kostik Belousov that uses uio_yield > looks like > a find solution. I intend to try it out on some servers RSN. > > -DG > > David G. Lawrence > President > Download Technologies, Inc. - http://www.downloadtech.com - (866) > 399 8500 > The FreeBSD Project - http://www.freebsd.org > Pave the road of life with opportunities. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"