Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2010 11:52:33 +0300
From:      Gleb Kurtsou <gleb.kurtsou@gmail.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-fs@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>, Konstantin Belousov <kib@freebsd.org>
Subject:   Re: zfs very poor performance compared to ufs due to lack of cache?
Message-ID:  <20100908085233.GA1850@tops>
In-Reply-To: <4C873914.40404@freebsd.org>
References:  <5DB6E7C798E44D33A05673F4B773405E@multiplay.co.uk> <AANLkTikNhsj5myhQCoPaNytUbpHtox1vg9AZm1N-OcMO@mail.gmail.com> <4C85E91E.1010602@icyb.net.ua> <4C873914.40404@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100908085233.GA1850>