From owner-freebsd-current@FreeBSD.ORG Fri Jul 17 00:09:43 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7DF1065672; Fri, 17 Jul 2009 00:09:43 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 363EF8FC12; Fri, 17 Jul 2009 00:09:42 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEZdX0qDaFvL/2dsb2JhbADSB4QNBYFA X-IronPort-AV: E=Sophos;i="4.42,414,1243828800"; d="scan'208";a="41489812" Received: from nile.cs.uoguelph.ca ([131.104.91.203]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 16 Jul 2009 20:09:42 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by nile.cs.uoguelph.ca (Postfix) with ESMTP id 6B1888D412B; Thu, 16 Jul 2009 20:09:42 -0400 (EDT) X-Virus-Scanned: amavisd-new at nile.cs.uoguelph.ca Received: from nile.cs.uoguelph.ca ([127.0.0.1]) by localhost (nile.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xZRRwkNzmkKn; Thu, 16 Jul 2009 20:09:41 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by nile.cs.uoguelph.ca (Postfix) with ESMTP id 658388D4072; Thu, 16 Jul 2009 20:09:41 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n6H0Cc911814; Thu, 16 Jul 2009 20:12:38 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Thu, 16 Jul 2009 20:12:38 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Anonymous In-Reply-To: <861vogcyp4.fsf@gmail.com> Message-ID: References: <861vogcyp4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Rick Macklem , freebsd-current@freebsd.org Subject: Re: [newnfs/client] -alldirs: listing files consumes too much memory X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2009 00:09:44 -0000 On Thu, 16 Jul 2009, Anonymous wrote: > Let's create 335 empty files in /blah and try to list them over nfsv3. > > # uname -vm > FreeBSD 8.0-BETA1 #0: Sat Jul 4 03:55:14 UTC 2009 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 > > # mkdir /blah > # (while [ $((i+=1)) -le 334 ]; do : >/blah/foo_$i; done) > # echo / -alldirs >/etc/exports > # /etc/rc.d/nfsd onestart > # mount -t newnfs -o nfsv3 0:/blah /mnt > Well, this turns out more interesting than I expected. The problem occurs when there is a large directory "at the mount point only". If you: # mount -t newnfs -o nfsv3 0:/ /mnt # cd /mnt/blah # ls - it works. When the large directory is at the mount point, it reads the first block normally but... it then thinks all subsequent blocks are already in the buffer cache. ie. They come back from getblk() with B_CACHE already set??? (It then just loops getting blocks forever, since it won't see the eof if it doesn't try and read from the server.) Anyone happen to have a clue why that would happen? Why would blocks on a mount point vnode behave differently than others. Well, at least it's easy to reproduce, so I can keep poking around with it, rick.