[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] [PATCH 1/2] Introduce posix_fallocate() to allocate disk space
- From: Daniel Veillard <veillard redhat com>
- To: Amit Shah <amit shah redhat com>
- Cc: libvir-list redhat com
- Subject: Re: [libvirt] [PATCH 1/2] Introduce posix_fallocate() to allocate disk space
- Date: Thu, 19 Mar 2009 13:20:28 +0100
On Thu, Mar 19, 2009 at 05:02:48PM +0530, Amit Shah wrote:
> On (Thu) Mar 19 2009 [10:39:05], Daniel P. Berrange wrote:
> > char * buf = mmap(NULL, len, MAP_SHARED, MAP_ANONYMOUS, fd, offset)
> > memset(buf, 0, len);
> > munmap(buf, len);
> >
> > Or, do your calloc() of a 1 MB chunk, and then call safewrite in a
> > loop, just to avoid too large a memory allocation.
>
> Yeah; I forgot the free().
>
> My approach was to never allocate more than 500MiB. However we can call
> safezero() itself with less than 500M; is 200M OK?
No IMHO that's definitely too big. Even 1MB is too much if you
can avoid it, please try to use mmap, if that dowsn't work then
use 1MB chunk,
thanks,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]