From owner-svn-src-head@FreeBSD.ORG Sat Dec 26 08:36:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA3A81065670; Sat, 26 Dec 2009 08:36:02 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D83148FC08; Sat, 26 Dec 2009 08:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQ8a2PY001810; Sat, 26 Dec 2009 08:36:02 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQ8a2ei001809; Sat, 26 Dec 2009 08:36:02 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912260836.nBQ8a2ei001809@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 26 Dec 2009 08:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201015 - head/sbin/nfsiod X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 08:36:03 -0000 Author: ru Date: Sat Dec 26 08:36:02 2009 New Revision: 201015 URL: http://svn.freebsd.org/changeset/base/201015 Log: - Display current settings when run without options. - Revise a manpage to NOT sound confusing. [1] In collaboration with: sat [1] Modified: head/sbin/nfsiod/nfsiod.8 head/sbin/nfsiod/nfsiod.c Modified: head/sbin/nfsiod/nfsiod.8 ============================================================================== --- head/sbin/nfsiod/nfsiod.8 Sat Dec 26 04:31:18 2009 (r201014) +++ head/sbin/nfsiod/nfsiod.8 Sat Dec 26 08:36:02 2009 (r201015) @@ -28,7 +28,7 @@ .\" From: @(#)nfsiod.8 8.2 (Berkeley) 2/22/94 .\" $FreeBSD$ .\" -.Dd September 22, 1994 +.Dd December 26, 2009 .Dt NFSIOD 8 .Os .Sh NAME @@ -42,33 +42,39 @@ asynchronous I/O server .Sh DESCRIPTION The .Nm -utility is a kernel process which runs on an +utility controls the maximum number of +.Nm +kernel processes which run on an .Tn NFS client machine to service asynchronous I/O requests to its server. -It improves performance but is not required for correct operation. -.Pp -This program controls the maximum number of processes that the kernel runs. +Having +.Nm +kernel processes +improves performance but is not required for correct operation. .Pp -The options are as follows: +The option is as follows: .Bl -tag -width indent .It Fl n -Specify how many servers are permitted to be started. +Specify how many processes are permitted to be started. .El .Pp -A client should run enough daemons to handle its maximum +Without an option, +.Nm +displays the current settings. +A client should allow enough number of processes to handle its maximum level of concurrency, typically four to six. .Pp If .Nm detects that the running kernel does not include .Tn NFS -support, it will attempt to load a loadable kernel module containing +support, it will attempt to load a kernel module containing .Tn NFS code, using .Xr kldload 2 . If this fails, or no .Tn NFS -KLD was available, +module was available, .Nm exits with an error. .Sh EXIT STATUS @@ -85,3 +91,10 @@ The .Nm utility first appeared in .Bx 4.4 . +.Pp +Starting with +.Fx 5.0 , +the utility no longer starts daemons, but only serves as a vfs +loader and +.Xr sysctl 3 +wrapper. Modified: head/sbin/nfsiod/nfsiod.c ============================================================================== --- head/sbin/nfsiod/nfsiod.c Sat Dec 26 04:31:18 2009 (r201014) +++ head/sbin/nfsiod/nfsiod.c Sat Dec 26 08:36:02 2009 (r201015) @@ -89,12 +89,12 @@ main(int argc, char *argv[]) case 'n': num_servers = atoi(optarg); if (num_servers < 1) { - warnx("nfsiod count %d; reset to %d", + warnx("nfsiod count %u; reset to %d", num_servers, 1); num_servers = 1; } if (num_servers > MAXNFSDCNT) { - warnx("nfsiod count %d; reset to %d", + warnx("nfsiod count %u; reset to %d", num_servers, MAXNFSDCNT); num_servers = MAXNFSDCNT; } @@ -109,9 +109,6 @@ main(int argc, char *argv[]) if (argc > 0) usage(); - if (num_servers == 0) - exit(0); /* no change */ - len = sizeof iodmin; error = sysctlbyname("vfs.nfs.iodmin", &iodmin, &len, NULL, 0); if (error < 0) @@ -120,6 +117,11 @@ main(int argc, char *argv[]) error = sysctlbyname("vfs.nfs.iodmax", &iodmax, &len, NULL, 0); if (error < 0) err(1, "sysctlbyname(\"vfs.nfs.iodmax\")"); + if (num_servers == 0) { /* no change */ + printf("vfs.nfs.iodmin=%u\nvfs.nfs.iodmax=%u\n", + iodmin, iodmax); + exit(0); + } /* Catch the case where we're lowering num_servers below iodmin */ if (iodmin > num_servers) { iodmin = num_servers;