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

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

 



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.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]