qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 18/29] hostmem: add file-based HostMemoryBack


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH v4 18/29] hostmem: add file-based HostMemoryBackend
Date: Tue, 10 Jun 2014 12:54:49 +0300

On Tue, Jun 10, 2014 at 11:07:35AM +0200, Igor Mammedov wrote:
> On Tue, 10 Jun 2014 16:30:06 +0800
> Hu Tao <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]