From owner-freebsd-stable@FreeBSD.ORG Tue Nov 23 06:14:43 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 429B9106566B; Tue, 23 Nov 2010 06:14:43 +0000 (UTC) (envelope-from alexz@visp.ru) Received: from mail.visp.ru (srv1.visp.ru [91.215.204.2]) by mx1.freebsd.org (Postfix) with ESMTP id E74498FC0A; Tue, 23 Nov 2010 06:14:42 +0000 (UTC) Received: from 91-215-205-255.static.visp.ru ([91.215.205.255] helo=zagrebin) by mail.visp.ru with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1PKm9H-000FtM-AZ; Tue, 23 Nov 2010 09:14:39 +0300 From: "Alexander Zagrebin" To: "'Andriy Gapon'" References: <3D1C350B94A44E5D95BAA1596D1EBF13@vosz.local> <20101029090417.GA17537@two.kliksys.ru> <4CCABFC2.3040701@icyb.net.ua> <4CCADD37.7000306@icyb.net.ua> <20101029152602.GA18613@two.kliksys.ru> <4CCAF0EB.4080001@icyb.net.ua> <20101029175105.GB18613@two.kliksys.ru> <4CCBD443.7010305@icyb.net.ua> <4CCBD46E.9030200@icyb.net.ua> <4CCBD661.3000204@freebsd.org> <4CCBEAF6.2030408@freebsd.org> Date: Tue, 23 Nov 2010 09:14:39 +0300 Message-ID: <6044ED86001A4358AA97FD83AA17A09C@vosz.local> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 In-Reply-To: <4CCBEAF6.2030408@freebsd.org> Thread-Index: Act4GD5NACL+NXGlSmaBrGb/93dA7ASvK9Sw Cc: freebsd-fs@freebsd.org, freebsd-stable@freebsd.org Subject: RE: 8.1-STABLE: zfs and sendfile: problem still exists X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 06:14:43 -0000 > -----Original Message----- > From: Andriy Gapon [mailto:avg@freebsd.org] > Sent: Saturday, October 30, 2010 1:53 PM > To: Artemiev Igor > Cc: freebsd-stable@freebsd.org; freebsd-fs@freebsd.org; > Alexander Zagrebin > Subject: Re: 8.1-STABLE: zfs and sendfile: problem still exists > > > Heh, next try. > > Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > =================================================================== > --- > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > (revision 214318) > +++ > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > (working copy) > @@ -67,6 +67,7 @@ > #include > #include > #include > +#include > > /* > * Programming rules. > @@ -464,7 +465,7 @@ > uiomove_fromphys(&m, off, bytes, uio); > VM_OBJECT_LOCK(obj); > vm_page_wakeup(m); > - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { > + } else if (uio->uio_segflg == UIO_NOCOPY) { > /* > * The code below is here to make > sendfile(2) work > * correctly with ZFS. As pointed out by ups@ > @@ -474,9 +475,23 @@ > */ > KASSERT(off == 0, > ("unexpected offset in mappedread > for sendfile")); > - if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) > + if (m != NULL && > vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) > goto again; > - vm_page_busy(m); > + if (m == NULL) { > + m = vm_page_alloc(obj, > OFF_TO_IDX(start), > + VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL); > + if (m == NULL) { > + VM_OBJECT_UNLOCK(obj); > + VM_WAIT; > + VM_OBJECT_LOCK(obj); > + goto again; > + } > + } else { > + vm_page_lock_queues(); > + vm_page_wire(m); > + vm_page_unlock_queues(); > + } > + vm_page_io_start(m); > VM_OBJECT_UNLOCK(obj); > if (dirbytes > 0) { > error = dmu_read_uio(os, zp->z_id, uio, > @@ -494,7 +509,10 @@ > VM_OBJECT_LOCK(obj); > if (error == 0) > m->valid = VM_PAGE_BITS_ALL; > - vm_page_wakeup(m); > + vm_page_io_finish(m); > + vm_page_lock_queues(); > + vm_page_unwire(m, 0); > + vm_page_unlock_queues(); > if (error == 0) { > uio->uio_resid -= bytes; > uio->uio_offset += bytes; > It seems that this patch isn't merged into RELENG_8. Are there chances that it will be merged before 8.2-RELEASE? -- Alexander Zagrebin