From owner-freebsd-current@FreeBSD.ORG Fri Jul 17 19:56:00 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 B5C641065678 for ; Fri, 17 Jul 2009 19:56:00 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id 404D78FC27 for ; Fri, 17 Jul 2009 19:56:00 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: by fg-out-1718.google.com with SMTP id 13so315691fge.12 for ; Fri, 17 Jul 2009 12:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=Fb6E2b/QBLOaQiaChbxKrtwAcOJxheJitZe3LYL1iVA=; b=DhQLJd22Wj6a8WoZ3Svdekb+IOyisKx1xibVwd12ktHV+uXnGUjRcoJJ04y2t47HoC BHeybvxfvag4JqvTq2y1smc8LtUf3O5Nk6ztu1jzY2ZQRA8226QULfLgdG4Wwm1zapEk 4FB/zBZmoemoT35LqATfgW3vpurIj+x1LkD18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=U4NGpUwI4wKDwDTW8rxRbOE5FVA81ms3JAPv6BVvUOBxc+hIPx9v5HHSvJMiZvaEPd 9fOSIA7jy3H7WyKBMGL1IkIOzr9myVZt9dTcRC6x/fAol4ypxkdKUL+43+y9as0ilYKa VfjAbCXnxfWrVTFi4cKv7g9oXJtKyGgMVlVvU= Received: by 10.86.90.8 with SMTP id n8mr1106550fgb.59.1247860559413; Fri, 17 Jul 2009 12:55:59 -0700 (PDT) Received: from localhost (95-24-64-233.broadband.corbina.ru [95.24.64.233]) by mx.google.com with ESMTPS id e11sm1863694fga.1.2009.07.17.12.55.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 12:55:58 -0700 (PDT) From: Anonymous To: Rick Macklem References: <861vogcyp4.fsf@gmail.com> Date: Fri, 17 Jul 2009 23:55:54 +0400 In-Reply-To: (Rick Macklem's message of "Fri, 17 Jul 2009 15:30:43 -0400 (EDT)") Message-ID: <86ws6713ud.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: 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 19:56:01 -0000 Rick Macklem writes: > 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 >> > Ok, I figured it out. I wasn't setting mp->mnt_stat.f_iosize before > getting the root vnode and, as such, getnewvnode() was setting > bo_bsize = 0. That confused getblk(), so it would always end up > returning block0, since it uses bo_bsize for a block calc. > > The patch follows, in case you're interested in testing it. > (I'll be queuing this patch up with re@ once I've tested it some more.) > > Thanks again for pointing the problem out, rick > -- patch for exp. nfs client -- [...] The patch fixed my problem. Tested on r195741M amd64.