From owner-freebsd-fs@FreeBSD.ORG Tue Jun 22 08:10:11 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 462D71065670; Tue, 22 Jun 2010 08:10:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A691F8FC13; Tue, 22 Jun 2010 08:10:09 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5M8A6Kk027434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 11:10:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5M8A506024451; Tue, 22 Jun 2010 11:10:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5M8A5SB024450; Tue, 22 Jun 2010 11:10:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Jun 2010 11:10:05 +0300 From: Kostik Belousov To: Alexander Leidinger Message-ID: <20100622081005.GQ13238@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> <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XxErtE42FmiGaS4u" Content-Disposition: inline In-Reply-To: <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org, alc@freebsd.org, fs@freebsd.org, pho@freebsd.org Subject: Re: Tmpfs elimination of double-copy 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: Tue, 22 Jun 2010 08:10:11 -0000 --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 (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--