Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2010 09:13:40 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-fs@freebsd.org, alc@freebsd.org, fs@freebsd.org, pho@freebsd.org
Subject:   Re: Tmpfs elimination of double-copy
Message-ID:  <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net>
In-Reply-To: <20100621184928.GI13238@deviant.kiev.zoral.com.ua>
References:  <20100621125825.GG13238@deviant.kiev.zoral.com.ua> <201006211030.55327.jhb@freebsd.org> <20100621184928.GI13238@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Kostik Belousov <kostikbel@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.

Bye,
Alexander.

-- 
At work, the authority of a person is inversely proportional to the
number of pens that person is carrying.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137



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