Re: [PATCHv2] openvz: read vmguarpages/privvmpages to set memory tunables

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

 



On Thu, May 03, 2012 at 02:37:00PM -0600, Eric Blake wrote:
> On 05/03/2012 11:13 AM, Guido Günther wrote:
> > ---
> > Changes since last time:
> >     * check sysconf return value before division
> >     * use virStrToLong_ull instead of sscanf
> > 
> > O.k. to apply?
> > Cheers,
> >  -- Guido
> 
> ACK.
> 
> 
> > +    long kb_per_pages;
> > +    unsigned long long barrier, limit, val;
> > +
> > +    virCheckFlags(0, -1);
> > +
> > +    kb_per_pages = sysconf(_SC_PAGESIZE);
> 
> A minor optimization is possible, since sysconf() won't change:
> 
> static long kb_per_pages;
> if (!kb_per_pages) {
>     kb_per_pages = sysconf(_SC_PAGESIZE):
>     if (kb_per_pages > 0)
>         kb_per_pages /= 1024;
> }
> if (kb_per_pages <= 0)
>     error...
> 
> for fewer syscalls over the life of the program.  But what you have is
> correct, and not worth a respin just for that tweak, so feel free to
> push as-is if you'd like.
Pushed now as is (after correcting one "make syntax-check" failure,
I'll change the code to the above in a follow up patch. Thanks!
Cheers,
 -- Guido

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]