From owner-freebsd-fs@FreeBSD.ORG Sat Oct 30 23:37:44 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 55947106566B; Sat, 30 Oct 2010 23:37:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DD8438FC0C; Sat, 30 Oct 2010 23:37:43 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o9UNbddd045480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Oct 2010 02:37:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o9UNbdiO068739; Sun, 31 Oct 2010 02:37:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o9UNbdbY068737; Sun, 31 Oct 2010 02:37:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 31 Oct 2010 02:37:39 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20101030233739.GE2392@deviant.kiev.zoral.com.ua> References: <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> <20101030101254.GB79691@two.kliksys.ru> <4CCBF45C.4080208@icyb.net.ua> <20101030112520.GD79691@two.kliksys.ru> <4CCC2F2A.7020809@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H0CA2egUVSYJgt8C" Content-Disposition: inline In-Reply-To: <4CCC2F2A.7020809@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org, freebsd-stable@freebsd.org Subject: Re: 8.1-STABLE: zfs and sendfile: problem still exists 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: Sat, 30 Oct 2010 23:37:44 -0000 --H0CA2egUVSYJgt8C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 30, 2010 at 05:43:54PM +0300, Andriy Gapon wrote: > on 30/10/2010 14:25 Artemiev Igor said the following: > > On Sat, Oct 30, 2010 at 01:33:00PM +0300, Andriy Gapon wrote: > >> on 30/10/2010 13:12 Artemiev Igor said the following: > >>> On Sat, Oct 30, 2010 at 12:52:54PM +0300, Andriy Gapon wrote: > >>> > >>>> Heh, next try. > >>> > >>> Got a panic, "vm_page_unwire: invalid wire count: 0" > >> > >> Oh, thank you for testing - forgot another piece (VM_ALLOC_WIRE for vm= _page_alloc): > >=20 > > Yep, it work. But VM_ALLOC_WIRE not exists in RELENG_8, therefore i sli= ghtly modified your patch: >=20 > I apologize for my haste, it should have been VM_ALLOC_WIRED. > Here is a corrected patch: > Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- 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 c= opy) > @@ -67,6 +67,7 @@ > #include > #include > #include > +#include >=20 > /* > * Programming rules. > @@ -464,7 +465,7 @@ > uiomove_fromphys(&m, off, bytes, uio); > VM_OBJECT_LOCK(obj); > vm_page_wakeup(m); > - } else if (m !=3D NULL && uio->uio_segflg =3D=3D UIO_NOCOPY) { > + } else if (uio->uio_segflg =3D=3D 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 =3D=3D 0, > ("unexpected offset in mappedread for sendfile")); > - if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) > + if (m !=3D NULL && vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) > goto again; > - vm_page_busy(m); > + if (m =3D=3D NULL) { > + m =3D vm_page_alloc(obj, OFF_TO_IDX(start), > + VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | VM_ALLOC_NORMAL); > + if (m =3D=3D 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); Why wiring the page if it is busied ? --H0CA2egUVSYJgt8C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzMrEIACgkQC3+MBN1Mb4jzjACgpf/B2jMS6qDaPNXeiZh9PsB8 srcAoOonoQX11nzARvxoXtKXWY7UVVJu =DbNN -----END PGP SIGNATURE----- --H0CA2egUVSYJgt8C--