From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuIlI-0006fJ-DP for qemu-devel@nongnu.org; Tue, 10 Jun 2014 05:54:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuIl9-0003HZ-4R for qemu-devel@nongnu.org; Tue, 10 Jun 2014 05:54:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuIl8-0003HJ-RG for qemu-devel@nongnu.org; Tue, 10 Jun 2014 05:54:27 -0400 Date: Tue, 10 Jun 2014 12:54:49 +0300 From: "Michael S. Tsirkin" Message-ID: <20140610095449.GF7423@redhat.com> References: <988dc97c3b3e3c89066b3b3dc8c17b3fccc3c816.1402299637.git.hutao@cn.fujitsu.com> <20140609133246.286d749c@thinkpad> <20140610020021.GD29724@G08FNSTD100614.fnst.cn.fujitsu.com> <480968011.20454430.1402376972892.JavaMail.zimbra@redhat.com> <20140610083006.GA12425@G08FNSTD100614.fnst.cn.fujitsu.com> <20140610110735.5f378e47@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140610110735.5f378e47@thinkpad> Subject: Re: [Qemu-devel] [PATCH v4 18/29] hostmem: add file-based HostMemoryBackend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Yasunori Goto , Hu Tao , qemu-devel@nongnu.org, Eduardo Habkost , Paolo Bonzini On Tue, Jun 10, 2014 at 11:07:35AM +0200, Igor Mammedov wrote: > On Tue, 10 Jun 2014 16:30:06 +0800 > Hu Tao wrote: > > > On Tue, Jun 10, 2014 at 01:09:32AM -0400, Paolo Bonzini wrote: > > > > > > > > > +#define TYPE_MEMORY_BACKEND_FILE "memory-backend-file" > > > > > how about naming it after what it really is? "memory-backend-hugepage" > > > > > Later we could split it into generic superclass mmap-ed > > > > > "memory-backend-file" and have TPH specific code moved into this backend. > > > > > > > > OK. > > > > > > Actually I don't think there's anything hugepage-specific in this backend > > > (except perhaps passing a path instead of a filename). It could be used > > > with a tmpfs backing storage like /dev/shm. > > > > What's the point compared to memory-backend-ram? > > > > Igor suggested memory-backend-file be compiled only for Linux. Does this mean > > memory-backend-file shuold be compiled also for systems supporting tmpfs > > or like? > I was too hasty with this suggestion, looking again at behind scenes > file_ram_alloc(), for now it works only with THP You mean Hugetlbfs I guess, not THP? > /gethugepagesize()/ but > it could be modified to run on non linux hosts as well and take /dev/shm or > just any file on host as backing storage. Yes, however there's a problem: on linux THP does not work with non anonymous memory at the moment. So using this feature would slow everything down as you get more TLB misses. That would be quite unexpected for users. Requiring hugetlbfs follows the principle of least surprise. > > > > > Regards, > > Hu > > > -- > Regards, > Igor