[pve-devel] [PATCH] add hugepages option v5
Wolfgang Bumiller
w.bumiller at proxmox.com
Wed Jun 8 10:55:00 CEST 2016
> On June 8, 2016 at 10:50 AM Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
>
>
>
> > On June 8, 2016 at 7:13 AM Alexandre DERUMIER <aderumier at odiso.com> wrote:
> >
> >
> > >>One possibility would be adding an inotify handler onto the qemu.slice
> > >>to pvestatd...
> >
> > another way, simply wrote a
> >
> > /var/run/qemu-server/vmid.hugepages when vm is starting, with hugepages topology
> >
> > then in pvestatd, if vm is down and vmid.hugepages file is present, cleanup memory and remove file
> >
> >
> > Like this we can avoid inotify (in case of pvestatd was stopped/hanging)
>
> A suggestion from Dietmar:
> How about pvestatd just regularly sets nr_hugepages to 0 while holding the lock?
> The numbers you write to the file get capped by what's available and in-use.
> Eg if nr_hugepages is 20, you have a VM using 8, and write 0 to it, then
> it'll contain 8. If we do this while holding the same lock we hold when
> starting a VM then this should work? Basically: allocate when starting, and
> let pve-statd free it regularly.
Btw. I just noticed that if I increase the number, then start using pages,
then set to 0, it'll show the number of used pages, and when the program
stops using them the number shrinks down to the previously written value,
so perhaps all we need to do is write 0 right after starting qemu so that
they get automatically freed once qemu exits?
More information about the pve-devel
mailing list