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

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



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


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