From owner-freebsd-fs@FreeBSD.ORG Sun Mar 21 13:43:29 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 24F051065672; Sun, 21 Mar 2010 13:43:29 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id 7511D8FC15; Sun, 21 Mar 2010 13:43:28 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id d26so241473eyd.9 for ; Sun, 21 Mar 2010 06:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=3GrOanLUokXyrqaW2uf/5/SaFG6t0x6kjWWWcbAeZKo=; b=V2y15MSgYhWfD7D5BvIfostj4wqIpO16IOwC6WwA1cW6YSvjtkzTgZjFBMU2D7Vu3z R+5DVcrtsEat0PJUUro7EL8l1+/qi6EsWp17p11uwvTHGDcPkq5rIpJdGQQZQrWxtsye TkxH8KnxjPzNTIrgaDFCtMAtIUKXABn1U/tQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=mj4kqetNsSZYnwAjBYjgIT/eiSsu3/JHYbo0jSLXWkzGm1BvFu+iQ8PLL1bso9vZcm XFtOPYGKMCPfsfgTaUUnReNbTSx3lQFVS7g/+JUdXUiugBV34ZS1pPccnDN4LeNozeQV OTPIjB3zgR9LMQ5xLC85yF5A/tGCv0e6Uyz8w= Received: by 10.213.37.14 with SMTP id v14mr846258ebd.28.1269179006986; Sun, 21 Mar 2010 06:43:26 -0700 (PDT) Received: from localhost ([95.69.160.238]) by mx.google.com with ESMTPS id 16sm1167804ewy.3.2010.03.21.06.43.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Mar 2010 06:43:25 -0700 (PDT) To: Rick Macklem References: <201003171120.o2HBK3CV082081@freefall.freebsd.org> <20100317113953.GA14582@icarus.home.lan> Organization: TOA Ukraine From: Mikolaj Golub Date: Sun, 21 Mar 2010 15:43:21 +0200 In-Reply-To: (Rick Macklem's message of "Wed\, 17 Mar 2010 18\:46\:27 -0400 \(EDT\)") Message-ID: <86tys9eqo6.fsf@kopusha.onet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-fs@FreeBSD.org, Kai Kockro , bug-followup@FreeBSD.org 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: Sun, 21 Mar 2010 13:43:29 -0000 --=-=-= Having debian in VirtualBOX I had some problems reproducing this until I ran a script that dropped for shot periods of time traffic from the nfs server to the client (using pf): block out on $if from any to while sleep 3; do sudo pfctl -t nfs -vT add 10.0.0.217; sleep 2; sudo pfctl -t nfs -vT show; sudo pfctl -t nfs -vT delete 10.0.0.217; done The idea was to drop NFS server responses to make the client resend requests and make RPC reply comes from the cache. And mbufs usage growth started to observe: 09:30: 2806/1589/4395 mbufs in use (current/cache/total) 10:00: 5397/1068/6465 mbufs in use (current/cache/total) 10:30: 7945/1760/9705 mbufs in use (current/cache/total) 11:00: 9560/1435/10995 mbufs in use (current/cache/total) 11:30: 10337/2113/12450 mbufs in use (current/cache/total) Athough it might be another issue then reported in this pr :-). Reviewing rpc/svc.c:svc_getreq() it looks for me that for RS_DONE case args are nevere freed. Shouldn't it be like in the attached patch? Running the above test on the patched kernel the growth has not been observed so far: 13:00: 1501/2219/3720 mbufs in use (current/cache/total) 13:30: 1514/2971/4485 mbufs in use (current/cache/total) 14:00: 1096/3389/4485 mbufs in use (current/cache/total) 14:30: 1107/3378/4485 mbufs in use (current/cache/total) 15:00: 1105/3380/4485 mbufs in use (current/cache/total) 15:30: 1105/3380/4485 mbufs in use (current/cache/total) -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=svc.c.svc_getreq.patch --- sys/rpc/svc.c.orig 2010-03-21 10:17:20.000000000 +0200 +++ sys/rpc/svc.c 2010-03-21 10:20:05.000000000 +0200 @@ -819,6 +819,7 @@ svc_getreq(SVCXPRT *xprt, struct svc_req free(r->rq_addr, M_SONAME); r->rq_addr = NULL; } + m_freem(args); goto call_done; default: --=-=-=--