From owner-freebsd-fs@FreeBSD.ORG Tue Mar 23 00:35:54 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 340EC106566B; Tue, 23 Mar 2010 00:35:53 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1D98FC24; Tue, 23 Mar 2010 00:35:53 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAFapp0uDaFvK/2dsb2JhbACbKnO+AIR9BI5O X-IronPort-AV: E=Sophos;i="4.51,291,1267419600"; d="scan'208";a="69924857" Received: from fraser.cs.uoguelph.ca ([131.104.91.202]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 22 Mar 2010 20:35:52 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by fraser.cs.uoguelph.ca (Postfix) with ESMTP id 8E0F7109C2EF; Mon, 22 Mar 2010 20:35:52 -0400 (EDT) X-Virus-Scanned: amavisd-new at fraser.cs.uoguelph.ca Received: from fraser.cs.uoguelph.ca ([127.0.0.1]) by localhost (fraser.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5YK87VunK0Ms; Mon, 22 Mar 2010 20:35:52 -0400 (EDT) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by fraser.cs.uoguelph.ca (Postfix) with ESMTP id 08F00109C263; Mon, 22 Mar 2010 20:35:52 -0400 (EDT) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id o2N0mop28799; Mon, 22 Mar 2010 20:48:50 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Mon, 22 Mar 2010 20:48:50 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Daniel Braniss In-Reply-To: Message-ID: References: <201003171120.o2HBK3CV082081@freefall.freebsd.org> <20100317113953.GA14582@icarus.home.lan> <86tys9eqo6.fsf@kopusha.onet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: bug-followup@FreeBSD.org, freebsd-fs@FreeBSD.org, Kai Kockro Subject: Re: kern/144330: [nfs] mbuf leakage in nfsd with zfs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2010 00:35:54 -0000 On Mon, 22 Mar 2010, Daniel Braniss wrote: [good stuff snipped] >> >> The initial leap doesn't worry me. That's just a design constraint. > yes, but new-nsfd does it better. > It's the classic tradeoff between a generic tool and one designed for a specific case. Because of quirks in NFSv4, the experimental server has no choice but to use a replay cache designed specifically for it and it knows assorted things about NFS. The one in sys/rpc/replay.c doesn't know anything about NFS, so it will be less efficient w.r.t. NFS. >> A slow leak after that is still a problem. (I might have seen the >> slow leak in testing here. I'll poke at it and see if I can reproduce >> that.) > > all I do is mount upd on a client and start a write process. > I only have a FreeBSD client at this point, and it doesn't cause the leak for nfsv3,udp for me here. Doug Rabson pointed out that there would be a leak for the "default:" case too, although didn't know if that would occur in practice. So, maybe you could test this variant of the patch (just in case that was the slow leak...): --- rpc/svc.c.sav 2010-03-21 18:46:20.000000000 -0400 +++ rpc/svc.c 2010-03-22 19:00:17.000000000 -0400 @@ -819,9 +819,11 @@ free(r->rq_addr, M_SONAME); r->rq_addr = NULL; } + m_freem(args); goto call_done; default: + m_freem(args); goto call_done; } } > there seems to be an NFSLOCK involved before calling replay_setsize ... > Ah, thanks for pointing that out. Thanks for the good testing. At least we're down to a slow leak..rick