Tmpfs elimination of double-copy

Kostik Belousov kostikbel at gmail.com
Tue Jun 22 08:10:11 UTC 2010


On Tue, Jun 22, 2010 at 09:13:40AM +0200, Alexander Leidinger wrote:
> Quoting Kostik Belousov <kostikbel at gmail.com> (from Mon, 21 Jun 2010  
> 21:49:28 +0300):
> 
> >Tmpfs uses OBJT_SWAP object to keep the data pages for the files.
> >Current code allocates another object of type OBJT_VNODE, assigned
> >to vp->v_object, to satisfy VM interface for mapping the file, using
> >vnode_create_vobject. The objects do not share the pages (I do not think
> >this can be easily achieved without serious changes to VM). Thus most,
> >if not all, the data is present in two sets of pages.
> >
> >When such file is written to, tmpfs copies user buffer both to the swap
> >object, and to the v_object.
> >
> >Patch I posted assigns the swap object to the vp->v_object. I had to
> >make small change to vm_mmap_vnode() to not allocate the vnode pager
> >and to not increment vnode use counter when v_object is the swap
> >object.
> 
> Did you measure the performance before/after? If not, what are your  
> performance expectations? I don't expect we get double the  
> performance, but if every data of a write is copied twice, I would  
> guess there is a measurable benefit.
No, I did not bothered. Real benefit of the change is the memory saving.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20100622/d2fcb52d/attachment-0001.pgp


More information about the freebsd-fs mailing list