From owner-freebsd-stable@FreeBSD.ORG Sun Mar 8 12:18:54 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91C6106564A for ; Sun, 8 Mar 2009 12:18:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B5C388FC15 for ; Sun, 8 Mar 2009 12:18:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6CDAB46BB7; Sun, 8 Mar 2009 08:18:54 -0400 (EDT) Date: Sun, 8 Mar 2009 12:18:54 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Yoshihiro Ota In-Reply-To: <20090308044012.0a666ff6.ota@j.email.ne.jp> Message-ID: References: <20090308044012.0a666ff6.ota@j.email.ne.jp> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: stable@freebsd.org Subject: Re: Where is nfsiod now? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 12:18:55 -0000 On Sun, 8 Mar 2009, Yoshihiro Ota wrote: > I thought rc used to start nfsiod if you set nfs_cilent_enable back years > ago. Now, on my 7.1-RELEASE machine, it sets up a couple of sysctls in > /etc/rc.d/nfsclient script but not nfsiod. > > Is nfsiod obsolete by now? > It is still on the system; does it still improve nfs performance? In the historic BSD kernel, kernel threads for services such as asynchronous NFS write-behind worker (which is what nfsiod is) were created via user processes that "donated" their thread context to the kernel by blocking in a syscall. In modern FreeBSD kernels, kernel threads can be created and destroyed arbitrarily within the kernel as required, so the size of the worker thread pool is controlled by sysctls -- by default there will be none unless required for an NFS mount, and then a pool will be maintained based on use with a limit. For example, on my box without NFS active, I see: robert@fledge:/usr/src/sbin/nfsiod> sysctl vfs.nfs | grep iod vfs.nfs.iodmax: 20 vfs.nfs.iodmin: 0 vfs.nfs.iodmaxidle: 120 We have a minimum of 0, a maximum of 20 workers, and idle workers are killed off after a timeout of 120 seconds. When using an NFS client with write-behind, you should see kernel threads named "nfsiod X" where X is the worker thread number. Take a look at src/sys/nfsclient/nfs_nfsiod.c for details. Robert N M Watson Computer Laboratory University of Cambridge