[PATCH] virnuma: Allow multiple nodes for preferred policy

Ján Tomko jtomko at redhat.com
Wed Dec 14 14:09:39 UTC 2022


On a Friday in 2022, Michal Privoznik wrote:
>In the past, the preferred policy
>(VIR_DOMAIN_NUMATUNE_MEM_PREFERRED) required exactly one (host)
>NUMA node. This made sense because:
>
>  1) the libnuma API - numa_set_preferred() allowed exactly one
>     node, because
>  2) corresponding kernel syscall (__NR_set_mempolicy) accepted
>     exactly one node (for MPOL_PREFERRED mode).
>
>But things have changed since then. Firstly, kernel introduced
>new MPOL_PREFERRED_MANY mode (v5.15-rc1~107^2~21) which was then
>exposed in libnuma as numa_set_preferred_many() (v2.0.15~24).
>
>Fortunately, libnuma also exposes numa_has_preferred_many() which
>returns whether the kernel has support for the new mode (1) or
>not (0).
>
>Putting this all together, we can lift our check for sufficiently
>new kernel and libnuma.
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151064
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> meson.build        |  3 +++
> src/util/virnuma.c | 25 +++++++++++++++++++++++--
> 2 files changed, 26 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20221214/d29174d7/attachment.sig>


More information about the libvir-list mailing list