From owner-cvs-src@FreeBSD.ORG Sat Sep 3 00:21:56 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C551116A41F; Sat, 3 Sep 2005 00:21:56 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BDEA43D48; Sat, 3 Sep 2005 00:21:56 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j830Lufp099394; Sat, 3 Sep 2005 00:21:56 GMT (envelope-from truckman@repoman.freebsd.org) Received: (from truckman@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j830LuEJ099393; Sat, 3 Sep 2005 00:21:56 GMT (envelope-from truckman) Message-Id: <200509030021.j830LuEJ099393@repoman.freebsd.org> From: Don Lewis Date: Sat, 3 Sep 2005 00:21:56 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/kern vfs_subr.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2005 00:21:56 -0000 truckman 2005-09-03 00:21:56 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/kern vfs_subr.c Log: MFC vfs_subr.c 1.636 and 1.642 vfs_subr.c 1.642 fixes a small race condition in vlrureclaim() and depends on 1.636. Modified files: sys/kern vfs_subr.c Log: - Allow vnlru to drop giant if the filesystem does not require it. The vnlru proc is extremely inefficient, potentially iteration over tens of thousands of vnodes without blocking. Droping Giant allows other threads to preempt us although we should revisit the algorithm to fix the runtime problems especially since this may hold up all vnode allocations. - Remove the LK_NOWAIT from the VOP_LOCK in vlrureclaim. This provides a natural blocking point to help alleviate the situation described above although it may not technically be desirable. - yield after we make a pass on all mount points to prevent us from blocking other threads which require Giant. MFC after: 2 weeks Revision Changes Path 1.636 +11 -2 src/sys/kern/vfs_subr.c Modified files: sys/kern vfs_subr.c Log: Back out the removal of LK_NOWAIT from the VOP_LOCK() call in vlrureclaim() in vfs_subr.c 1.636 because waiting for the vnode lock aggravates an existing race condition. It is also undesirable according to the commit log for 1.631. Fix the tiny race condition that remains by rechecking the vnode state after grabbing the vnode lock and grabbing the vnode interlock. Fix the problem of other threads being starved (which 1.636 attempted to fix by removing LK_NOWAIT) by calling uio_yield() periodically in vlrureclaim(). This should be more deterministic than hoping that VOP_LOCK() without LK_NOWAIT will block, which may not happen in this loop. Reviewed by: kan MFC after: 5 days Revision Changes Path 1.642 +37 -7 src/sys/kern/vfs_subr.c Approved by: re (scottl) Revision Changes Path 1.635.2.4 +46 -7 src/sys/kern/vfs_subr.c