From owner-freebsd-fs@FreeBSD.ORG Wed Sep 8 07:36: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 E9A8110656DF for ; Wed, 8 Sep 2010 07:36:29 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 370CA8FC12 for ; Wed, 8 Sep 2010 07:36:28 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA07020; Wed, 08 Sep 2010 10:19:49 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OtEwf-0000PF-6j; Wed, 08 Sep 2010 10:19:49 +0300 Message-ID: <4C873914.40404@freebsd.org> Date: Wed, 08 Sep 2010 10:19:48 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.8) Gecko/20100822 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Wiktor Niesiobedzki , Pawel Jakub Dawidek , Konstantin Belousov References: <5DB6E7C798E44D33A05673F4B773405E@multiplay.co.uk> <4C85E91E.1010602@icyb.net.ua> In-Reply-To: <4C85E91E.1010602@icyb.net.ua> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org 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 07:36:30 -0000 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 data into > the page? > I specifically speak of the block that starts with the following line: > } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { > I am taking mdstart_swap as an example and it does m->valid = VM_PAGE_BITS_ALL. > I've chatted with and conclusion seems to be that vm_page_set_validclean() call should be added at the end of the block. Perhaps, something like this: --- 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); vm_page_wakeup(m); if (error == 0) uio->uio_resid -= bytes; BTW, I think that 'off' variable can be made of 'int' type, as it is an offset within a page; no need for int64. -- Andriy Gapon