From owner-freebsd-fs@FreeBSD.ORG Tue Feb 8 21:52:09 2011 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 1888D106566B for ; Tue, 8 Feb 2011 21:52:09 +0000 (UTC) (envelope-from admin@kkip.pl) Received: from mainframe.kkip.pl (kkip.pl [87.105.164.78]) by mx1.freebsd.org (Postfix) with ESMTP id A3CAA8FC0A for ; Tue, 8 Feb 2011 21:52:08 +0000 (UTC) Received: from static-78-8-144-74.ssp.dialog.net.pl ([78.8.144.74] helo=[192.168.0.2]) by mainframe.kkip.pl with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1PmvTa-0001jK-TH; Tue, 08 Feb 2011 22:52:06 +0100 Message-ID: <4D51BAFC.50806@kkip.pl> Date: Tue, 08 Feb 2011 22:51:56 +0100 From: Bartosz Stec User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pl; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Kostik Belousov References: <4D510BBB.1060708@kkip.pl> <20110208102727.GA8555@icarus.home.lan> <4D511F65.2050503@kkip.pl> <4D519F97.2000805@kkip.pl> <20110208203653.GC78089@deviant.kiev.zoral.com.ua> <20110208213721.GE78089@deviant.kiev.zoral.com.ua> In-Reply-To: <20110208213721.GE78089@deviant.kiev.zoral.com.ua> X-Authenticated-User: admin@kkip.pl X-Authenticator: plain X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Spam-Score: -8.5 X-Spam-Score-Int: -84 X-Exim-Version: 4.73 (build at 10-Jan-2011 16:29:01) X-Date: 2011-02-08 22:52:06 X-Connected-IP: 78.8.144.74:56574 X-Message-Linecount: 224 X-Body-Linecount: 211 X-Message-Size: 7879 X-Body-Size: 7005 X-Received-Count: 1 X-Recipient-Count: 2 X-Local-Recipient-Count: 2 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-fs@freebsd.org Subject: Re: Memory leak in 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, 08 Feb 2011 21:52:09 -0000 W dniu 2011-02-08 22:37, Kostik Belousov pisze: > On Wed, Feb 09, 2011 at 12:22:01AM +0300, Emil Muratov wrote: >>> Try this. I the similar fix is needed for tmpfs, but there are some >>> more issues and pending rewrite, so I decided not to touch it. >>> >>> commit 8e5885bce1afecd419e40240a2d7ab90deb0392a >>> Author: Konstantin Belousov >>> Date: Tue Feb 8 22:35:29 2011 +0200 >>> >>> Do not forget to activate the page >>> >>> diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >>> b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >>> index e8191b3..7343c72 100644 >>> --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >>> +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >> >> What is this patch up against? I can't apply it to the STABLE. :( > HEAD. > > I adopted the patch to stable/8, but did not even compiled it. > > Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > =================================================================== > --- cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 218456) > +++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) > @@ -347,6 +347,9 @@ page_unlock(vm_page_t pp) > { > > vm_page_wakeup(pp); > + vm_page_lock_queues(); > + vm_page_activate(pp); > + vm_page_unlock_queues(); > } > > static caddr_t > @@ -465,7 +468,7 @@ again: > if (error == 0) > uiomove_fromphys(&m, off, bytes, uio); > VM_OBJECT_LOCK(obj); > - vm_page_wakeup(m); > + page_unlock(m); > } else if (uio->uio_segflg == UIO_NOCOPY) { > /* > * The code below is here to make sendfile(2) work > @@ -504,10 +507,16 @@ again: > zfs_unmap_page(sf); > } > VM_OBJECT_LOCK(obj); > - if (error == 0) > - m->valid = VM_PAGE_BITS_ALL; > vm_page_io_finish(m); > + vm_page_lock_queues(); > if (error == 0) { > + m->valid = VM_PAGE_BITS_ALL; > + vm_page_activate(m); > + } else > + vm_page_free(m); > + vm_page_unlock_queues(); > + > + if (error == 0) { > uio->uio_resid -= bytes; > uio->uio_offset += bytes; > } Patching was succesfull # patch < patch Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c |=================================================================== |--- cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 218456) |+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) -------------------------- Patching file zfs_vnops.c using Plan A... Hunk #1 succeeded at 347. Hunk #2 succeeded at 468. Hunk #3 succeeded at 507. Hmm... Ignoring the trailing garbage. done Now what's the recommended way to apply above changes to system (without rebuilding whole universe...)? -- Bartosz Stec