From owner-freebsd-questions Tue May 15 16: 2:51 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mx01-a.netapp.com (mx01-a.netapp.com [198.95.226.53]) by hub.freebsd.org (Postfix) with ESMTP id C330637B61E for ; Tue, 15 May 2001 16:02:42 -0700 (PDT) (envelope-from boshea@netapp.com) Received: from frejya.corp.netapp.com (frejya.corp.netapp.com [10.10.20.91]) by mx01-a.netapp.com (8.11.1/8.11.1/NTAP-1.2) with ESMTP id f4FN2gK08893 for ; Tue, 15 May 2001 16:02:42 -0700 (PDT) Received: from shaolin.hq.netapp.com (localhost [127.0.0.1]) by frejya.corp.netapp.com (8.11.1/8.11.1/NTAP-1.2) with ESMTP id f4FN2f107450 for ; Tue, 15 May 2001 16:02:41 -0700 (PDT) Received: (from boshea@localhost) by shaolin.hq.netapp.com (8.9.3/8.9.3) id QAA62633 for freebsd-questions@freebsd.org; Tue, 15 May 2001 16:10:52 -0700 (PDT) (envelope-from boshea) Date: Tue, 15 May 2001 16:10:52 -0700 From: "Brian O'Shea" To: freebsd-questions@freebsd.org Subject: tail(1) uses kqueue, which doesn't seem to work on NFS filesystems Message-ID: <20010515161052.O1813@shaolin.hq.netapp.com> Reply-To: boshea@ricochet.net Mail-Followup-To: Brian O'Shea , freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I have noticed that the tail(1) command uses kevent(2) to poll a file when the -f option is specified. This works great for files on UFS filesystems, however when the file is on an NFS mounted volume, tail spins, consuming much CPU time. Is there an option to tail that causes it to not use kevent? Running tail -f on a UFS filesystem: load: 0.19 cmd: tail 62159 [kqread] 0.00u 0.00s 0% 364k Running tail -f on a NFS filesystem: load: 0.86 cmd: tail 62546 [running] 12.66u 74.50s 96% 376k I noticed in the code for tail(1) (src/usr.bin/tail/forward.c) that there is a local variable in the forward() function called "action" which seems to control weather or not tail uses sleep or kqueue (it seems to be assigned one of three values at various times, defined respectively to be USE_SLEEP, USE_KQUEUE, and ADD_EVENTS). However, it isn't clear to me from looking at the code if this variable can be used to disable the use of kqueue. Thanks, -brian p.s. I realize the inherent value of the kqueue/kevent interface, however in this particular case (and I suspect I'm not alone), many of the files that I have to deal with are on NFS mounted volumes (I work for a storage company; eating our own dogfood and all that...). -- Brian O'Shea To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message