From owner-freebsd-fs@FreeBSD.ORG Wed Sep 8 08:49:04 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 78EAC10656C2; Wed, 8 Sep 2010 08:49:04 +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 C67578FC28; Wed, 8 Sep 2010 08:49:03 +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 o888muvF041050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Sep 2010 11:48:56 +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 o888mugG005788; Wed, 8 Sep 2010 11:48:56 +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 o888mtZB005787; Wed, 8 Sep 2010 11:48:56 +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: Wed, 8 Sep 2010 11:48:55 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20100908084855.GF2465@deviant.kiev.zoral.com.ua> References: <5DB6E7C798E44D33A05673F4B773405E@multiplay.co.uk> <4C85E91E.1010602@icyb.net.ua> <4C873914.40404@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E7i4zwmWs5DOuDSH" Content-Disposition: inline In-Reply-To: <4C873914.40404@freebsd.org> 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=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, 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, Pawel Jakub Dawidek Subject: Re: zfs very poor performance compared to ufs due to lack of cache? 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: Wed, 08 Sep 2010 08:49:04 -0000 --E7i4zwmWs5DOuDSH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 08, 2010 at 10:19:48AM +0300, Andriy Gapon wrote: > on 07/09/2010 10:26 Andriy Gapon said the following: > > Interesting. I briefly looked at the code in mappedread(), zfs_vnops.c= , and I > > have a VM question. > > Shouldn't we mark the corresponding page bits as valid after reading da= ta into > > the page? > > I specifically speak of the block that starts with the following line: > > } else if (m !=3D NULL && uio->uio_segflg =3D=3D UIO_NOCOPY) { > > I am taking mdstart_swap as an example and it does m->valid =3D VM_PAGE= _BITS_ALL. > >=20 >=20 > I've chatted with and conclusion seems to be that vm_page_set_validclean(= ) call > should be added at the end of the block. >=20 > Perhaps, something like this: >=20 > --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > @@ -500,6 +500,7 @@ again: > sched_unpin(); > } > VM_OBJECT_LOCK(obj); > + vm_page_set_validclean(m, off, bytes); Only if error =3D=3D 0, perhaps ? > vm_page_wakeup(m); > if (error =3D=3D 0) > uio->uio_resid -=3D bytes; >=20 >=20 > BTW, I think that 'off' variable can be made of 'int' type, as it is an o= ffset > within a page; no need for int64. >=20 > --=20 > Andriy Gapon --E7i4zwmWs5DOuDSH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyHTfcACgkQC3+MBN1Mb4gIeACgm4qHkuJVwqfQNcsYuzgpSkcQ tvoAoO0JAwtgqTdovoyGUmYgX6UDJaPO =GcfI -----END PGP SIGNATURE----- --E7i4zwmWs5DOuDSH--