Date: Tue, 22 Jun 2010 11:10:05 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Alexander Leidinger <Alexander@leidinger.net> Cc: freebsd-fs@freebsd.org, alc@freebsd.org, fs@freebsd.org, pho@freebsd.org Subject: Re: Tmpfs elimination of double-copy Message-ID: <20100622081005.GQ13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net> References: <20100621125825.GG13238@deviant.kiev.zoral.com.ua> <201006211030.55327.jhb@freebsd.org> <20100621184928.GI13238@deviant.kiev.zoral.com.ua> <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--XxErtE42FmiGaS4u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 22, 2010 at 09:13:40AM +0200, Alexander Leidinger wrote: > Quoting Kostik Belousov <kostikbel@gmail.com> (from Mon, 21 Jun 2010 =20 > 21:49:28 +0300): >=20 > >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. >=20 > Did you measure the performance before/after? If not, what are your =20 > performance expectations? I don't expect we get double the =20 > performance, but if every data of a write is copied twice, I would =20 > guess there is a measurable benefit. No, I did not bothered. Real benefit of the change is the memory saving. --XxErtE42FmiGaS4u Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwgb90ACgkQC3+MBN1Mb4hcjACgvCN4lP/CaDtJXtaSzu5mfZr7 ohUAnj3IZNduld24zY8kys7dZ4OQBahg =IicH -----END PGP SIGNATURE----- --XxErtE42FmiGaS4u--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100622081005.GQ13238>