[PATCH] qemu: Use thread-context even with numatune's restrive mode

Martin Kletzander posted 1 patch 10 months, 2 weeks ago
Failed in applying to current master (apply log)
src/qemu/qemu_command.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] qemu: Use thread-context even with numatune's restrive mode
Posted by Martin Kletzander 10 months, 2 weeks ago
We cannot use host-nodes attribute for it, but there is no reason for us
to skip the preallocation optimisation using thread-context in such
case.  Thankfully returning the proper nodemask from
qemuBuildMemoryBackendProps is enough to trigger this.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
 src/qemu/qemu_command.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9b993c3aad76..cb09fed0676a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3245,7 +3245,7 @@ qemuBuildMemoryGetPagesize(virQEMUDriverConfig *cfg,
  * @def: domain definition object
  * @mem: memory definition object
  * @force: forcibly use one of the backends
- * @nodemaskRet: [out] bitmap used to format .host-nodes attribute
+ * @nodemaskRet: [out] bitmap where the memory should be allocated
  *
  * Creates a configuration object that represents memory backend of given guest
  * NUMA node (domain @def and @mem). Use @priv->autoNodeset to fine tune the
@@ -3458,10 +3458,10 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
                                       "S:policy", qemuNumaPolicyTypeToString(mode),
                                       NULL) < 0)
                 return -1;
-
-            if (nodemaskRet)
-                *nodemaskRet = nodemask;
         }
+
+        if (nodemaskRet)
+            *nodemaskRet = nodemask;
     }
 
     /* If none of the following is requested... */
-- 
2.40.1
Re: [PATCH] qemu: Use thread-context even with numatune's restrive mode
Posted by Ján Tomko 10 months, 2 weeks ago
On a Friday in 2023, Martin Kletzander wrote:
>We cannot use host-nodes attribute for it, but there is no reason for us
>to skip the preallocation optimisation using thread-context in such
>case.  Thankfully returning the proper nodemask from
>qemuBuildMemoryBackendProps is enough to trigger this.
>

s/restrive/restrictive/ in the commit summary

>Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
>---
> src/qemu/qemu_command.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>

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

Jano