From owner-freebsd-fs@FreeBSD.ORG Tue Jun 22 07:13:48 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 44A47106566C; Tue, 22 Jun 2010 07:13:48 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 944FC8FC15; Tue, 22 Jun 2010 07:13:47 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2C147.dip.t-dialin.net [217.226.193.71]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id EA8FA844042; Tue, 22 Jun 2010 09:13:43 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id E8B845464; Tue, 22 Jun 2010 09:13:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1277190821; bh=bNKRe9dI9JKK80Xmba4JnO2WvY75uBPWEsqe2cmzpso=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=iMZkwdoCZQh8HWYv5OIhR3YOXBCKWniuUEG04j5JndgVFGclZH/cxhMp5qZNPgjBG tkQ8CFvo1VJH7bRXiIFn6JsfN6M7aocjDXE4zAfV3PL77EAoWMopd8InecWcggQMGb G/KyXlKw/sbJ3MWUV3aSc7rBxbm1BdGtwBJnDwXBzdNtbYbpBS5NqLduBh7E/Sqd0N VrgH/F3CyC9bgkmQjxAMKDrfJs0Dod28RMFOKp9NVmud4B9FWyqCP8sa+fRQMHQzEg Y6Z+jw/PppHjycOBkUXmzMtPVVrkFknw45+fxBk4LcyVmrenW6UnelRoxxeiXR8SuE 3+i0n8awUcE/A== Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o5M7DeER071507; Tue, 22 Jun 2010 09:13:40 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 22 Jun 2010 09:13:40 +0200 Message-ID: <20100622091340.25034svc6uz3k4g0@webmail.leidinger.net> Date: Tue, 22 Jun 2010 09:13:40 +0200 From: Alexander Leidinger To: Kostik Belousov References: <20100621125825.GG13238@deviant.kiev.zoral.com.ua> <201006211030.55327.jhb@freebsd.org> <20100621184928.GI13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100621184928.GI13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: EA8FA844042.A6CC9 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.1, required 6, autolearn=disabled, ALL_TRUSTED -1.00, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1277795625.41418@tFTYTAbB3VzeSsOT1qqv4g X-EBL-Spam-Status: No 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 07:13:48 -0000 Quoting Kostik Belousov (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