From owner-cvs-src@FreeBSD.ORG Fri Jun 10 23:50:42 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 3778C16A41C; Fri, 10 Jun 2005 23:50:42 +0000 (GMT) (envelope-from green@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CC6443D53; Fri, 10 Jun 2005 23:50:42 +0000 (GMT) (envelope-from green@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 j5ANofU5008213; Fri, 10 Jun 2005 23:50:41 GMT (envelope-from green@repoman.freebsd.org) Received: (from green@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5ANofFM008212; Fri, 10 Jun 2005 23:50:41 GMT (envelope-from green) Message-Id: <200506102350.j5ANofFM008212@repoman.freebsd.org> From: Brian Feldman Date: Fri, 10 Jun 2005 23:50:41 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/nfsclient nfs_bio.c nfs_vfsops.c nfsargs.h nfsmount.h src/sys/sys buf.h bufobj.h src/sys/kern vfs_bio.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: Fri, 10 Jun 2005 23:50:42 -0000 green 2005-06-10 23:50:41 UTC FreeBSD src repository Modified files: sys/nfsclient nfs_bio.c nfs_vfsops.c nfsargs.h nfsmount.h sys/sys buf.h bufobj.h sys/kern vfs_bio.c Log: Fix a serious deadlock with the NFS client. Given a large enough atomic write request, it can fill the buffer cache with the entirety of that write in order to handle retries. However, it never drops the vnode lock, or else it wouldn't be atomic, so it ends up waiting indefinitely for more buf memory that cannot be gotten as it has it all, and it waits in an uncancellable state. To fix this, hibufspace is exported and scaled to a reasonable fraction. This is used as the limit of how much of an atomic write request by the NFS client will be handled asynchronously. If the request is larger than this, it will be turned into a synchronous request which won't deadlock the system. It's possible this value is far off from what is required by some, so it shall be tunable as soon as mount_nfs(8) learns of the new field. The slowdown between an asynchronous and a synchronous write on NFS appears to be on the order of 2x-4x. General nod by: gad MFC after: 2 weeks More testing: wes PR: kern/79208 Revision Changes Path 1.489 +1 -1 src/sys/kern/vfs_bio.c 1.151 +65 -0 src/sys/nfsclient/nfs_bio.c 1.177 +9 -0 src/sys/nfsclient/nfs_vfsops.c 1.68 +2 -2 src/sys/nfsclient/nfsargs.h 1.30 +1 -0 src/sys/nfsclient/nfsmount.h 1.186 +1 -0 src/sys/sys/buf.h 1.15 +2 -2 src/sys/sys/bufobj.h