From owner-freebsd-fs@FreeBSD.ORG Wed Sep 8 08:52:42 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 1FD9C10656DD; Wed, 8 Sep 2010 08:52:42 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5239A8FC21; Wed, 8 Sep 2010 08:52:40 +0000 (UTC) Received: by ewy4 with SMTP id 4so3237731ewy.13 for ; Wed, 08 Sep 2010 01:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=7QmUhPQ/AbClF2mkeCZaj80aMt4dGHA32ded1kVslNM=; b=ETs1166WHgXlV1qnfKBRN1h4FXzMOvA9MiXS2IU/U2gtuXaKGLY0kCTSzgJMQDM1UK AGAyjSdNmQDuiBGFmfDGtX8iiJiG+V44ZFQhBP69Z2TDcEhwNy+C1QRmexWdCCVJAsDJ jtBtG09+/WZuuGKrRZLg6w5Tct28gbGC3ggv0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=W4s4+4SyZW9/78OPmg11qMXSzME8tnJdeXRVu93RUGpZ1QrZeLWNJmuOk3ZmjFt4GT oTjEaHz2kJAKCEQuuk94uoAw3LFoLeLoVCg8gAx7QyPdbxc9IfdVuIxBLhEZHH4I7qlb ok8cwU4DP0wkGDyLDmU+jWtqdH8YDgHoKuLxE= Received: by 10.213.2.207 with SMTP id 15mr617222ebk.9.1283935960099; Wed, 08 Sep 2010 01:52:40 -0700 (PDT) Received: from localhost ([212.98.186.134]) by mx.google.com with ESMTPS id v8sm11526816eeh.2.2010.09.08.01.52.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Sep 2010 01:52:39 -0700 (PDT) Date: Wed, 8 Sep 2010 11:52:33 +0300 From: Gleb Kurtsou To: Andriy Gapon Message-ID: <20100908085233.GA1850@tops> References: <5DB6E7C798E44D33A05673F4B773405E@multiplay.co.uk> <4C85E91E.1010602@icyb.net.ua> <4C873914.40404@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4C873914.40404@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org, Pawel Jakub Dawidek , Konstantin Belousov 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:52:42 -0000 On (08/09/2010 10:19), 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 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. I had something similar to this patch but I've backed it out for unknown reason, can't find any details. Did you try running fsx with it? You might also be interested in recent patches to mapped read/write in tmpfs by Alan Cox the code is very similar to ZFS. Thanks, Gleb. > > -- > Andriy Gapon > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"