qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: qemu-devel@nongnu.org, "Michal Privoznik" <mprivozn@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Stefan Weil" <sw@weilnetz.de>
Subject: Re: [PATCH v1 4/7] util: Add write-only "node-affinity" property for ThreadContext
Date: Thu, 29 Sep 2022 13:13:59 +0200	[thread overview]
Message-ID: <87a66itoug.fsf@pond.sub.org> (raw)
In-Reply-To: <20220928164542.117952-5-david@redhat.com> (David Hildenbrand's message of "Wed, 28 Sep 2022 18:45:39 +0200")

David Hildenbrand <david@redhat.com> writes:

> Let's make it easier to pin threads created via a ThreadContext to
> all current CPUs belonging to given NUMA nodes.
>
> As "node-affinity" is simply a shortcut for setting "cpu-affinity", that
> property cannot be read and if the CPUs for a node change due do CPU
> hotplug, the CPU affinity will not get updated.

Color me confused.

> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  qapi/qom.json         |  7 +++-
>  util/meson.build      |  2 +-
>  util/thread-context.c | 84 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 91 insertions(+), 2 deletions(-)
>
> diff --git a/qapi/qom.json b/qapi/qom.json
> index 4775a333ed..d36bf3355f 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -838,10 +838,15 @@
>  # @cpu-affinity: the CPU affinity for all threads created in the thread
>  #                context (default: QEMU main thread affinity)
>  #
> +# @node-affinity: shortcut for looking up the current CPUs for the given nodes
> +#                 and setting @cpu-affinity (default: QEMU main thread
> +#                 affinity)
> +#

Still confused.  Explain for dummies?  With an example, perhaps?

>  # Since: 7.2
>  ##
>  { 'struct': 'ThreadContextProperties',
> -  'data': { '*cpu-affinity': ['uint16'] } }
> +  'data': { '*cpu-affinity': ['uint16'],
> +            '*node-affinity': ['uint16'] } }
>  
>  
>  ##

[...]



  reply	other threads:[~2022-09-29 11:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 16:45 [PATCH v1 0/7] hostmem: NUMA-aware memory preallocation using ThreadContext David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 1/7] util: Cleanup and rename os_mem_prealloc() David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 2/7] util: Introduce qemu_thread_set_affinity() and qemu_thread_get_affinity() David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 3/7] util: Introduce ThreadContext user-creatable object David Hildenbrand
2022-09-29 11:12   ` Markus Armbruster
2022-09-29 11:18     ` David Hildenbrand
2022-09-29 12:25       ` Markus Armbruster
2022-09-29 16:05         ` David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 4/7] util: Add write-only "node-affinity" property for ThreadContext David Hildenbrand
2022-09-29 11:13   ` Markus Armbruster [this message]
2022-09-30  9:17     ` David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 5/7] util: Make qemu_prealloc_mem() optionally consume a ThreadContext David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 6/7] hostmem: Allow for specifying a ThreadContext for preallocation David Hildenbrand
2022-09-28 16:45 ` [PATCH v1 7/7] vl: Allow ThreadContext objects to be created before the sandbox option David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a66itoug.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).