All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: bharata@linux.vnet.ibm.com
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	kvm list <kvm@vger.kernel.org>, Alexander Graf <agraf@suse.de>,
	qemu-devel Developers <qemu-devel@nongnu.org>,
	Chris Wright <chrisw@sous-sol.org>,
	dipankar@in.ibm.com, Vaidyanathan S <svaidy@in.ibm.com>
Subject: Re: [RFC PATCH] Exporting Guest RAM information for NUMA binding
Date: Mon, 21 Nov 2011 16:25:26 +0100	[thread overview]
Message-ID: <1321889126.28118.5.camel@twins> (raw)
In-Reply-To: <20111121150054.GA3602@in.ibm.com>

On Mon, 2011-11-21 at 20:48 +0530, Bharata B Rao wrote:

> I looked at Peter's recent work in this area.
> (https://lkml.org/lkml/2011/11/17/204)
> 
> It introduces two interfaces:
> 
> 1. ms_tbind() to bind a thread to a memsched(*) group
> 2. ms_mbind() to bind a memory region to memsched group
> 
> I assume the 2nd interface could be used by QEMU to create
> memsched groups for each of guest NUMA node memory regions.

No, you would need both, you'll need to group vcpu threads _and_ some
vaddress space together.

I understood QEMU currently uses a single big anonymous mmap() to
allocate the guest memory, using this you could either use multiple or
carve up the big alloc into virtual nodes by assigning different parts
to different ms groups.

Example: suppose you want to create a 2 node guest with 8 vcpus, create
2 ms groups, each with 4 vcpu threads and assign half the total guest
mmap to either.

> In the past, Anthony has said that NUMA binding should be done from outside
> of QEMU (http://www.kerneltrap.org/mailarchive/linux-kvm/2010/8/31/6267041)

If you want to expose a sense of virtual NUMA to your guest you really
have no choice there. The only thing you can do externally is run whole
VMs inside one particular node.

> Though that was in a different context, may be we should re-look at that
> and see if QEMU still sticks to that. I know its a bit early, but if needed
> we should ask Peter to consider extending ms_mbind() to take a tid parameter
> too instead of working on current task by default.

Uh, what for? ms_mbind() works on the current process, not task.

> (*) memsched: An abstraction for representing coupling of threads with virtual
> address ranges. Threads and virtual address ranges of a memsched group are
> guaranteed (?) to be located on the same node.

Yeah, more or less so. We could relax that slightly to allow tasks to
run away from the node for very short periods of time, but basically
that's the provided guarantee.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: bharata@linux.vnet.ibm.com
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	kvm list <kvm@vger.kernel.org>, Alexander Graf <agraf@suse.de>,
	qemu-devel Developers <qemu-devel@nongnu.org>,
	Chris Wright <chrisw@sous-sol.org>,
	dipankar@in.ibm.com, Vaidyanathan S <svaidy@in.ibm.com>
Subject: Re: [Qemu-devel] [RFC PATCH] Exporting Guest RAM information for NUMA binding
Date: Mon, 21 Nov 2011 16:25:26 +0100	[thread overview]
Message-ID: <1321889126.28118.5.camel@twins> (raw)
In-Reply-To: <20111121150054.GA3602@in.ibm.com>

On Mon, 2011-11-21 at 20:48 +0530, Bharata B Rao wrote:

> I looked at Peter's recent work in this area.
> (https://lkml.org/lkml/2011/11/17/204)
> 
> It introduces two interfaces:
> 
> 1. ms_tbind() to bind a thread to a memsched(*) group
> 2. ms_mbind() to bind a memory region to memsched group
> 
> I assume the 2nd interface could be used by QEMU to create
> memsched groups for each of guest NUMA node memory regions.

No, you would need both, you'll need to group vcpu threads _and_ some
vaddress space together.

I understood QEMU currently uses a single big anonymous mmap() to
allocate the guest memory, using this you could either use multiple or
carve up the big alloc into virtual nodes by assigning different parts
to different ms groups.

Example: suppose you want to create a 2 node guest with 8 vcpus, create
2 ms groups, each with 4 vcpu threads and assign half the total guest
mmap to either.

> In the past, Anthony has said that NUMA binding should be done from outside
> of QEMU (http://www.kerneltrap.org/mailarchive/linux-kvm/2010/8/31/6267041)

If you want to expose a sense of virtual NUMA to your guest you really
have no choice there. The only thing you can do externally is run whole
VMs inside one particular node.

> Though that was in a different context, may be we should re-look at that
> and see if QEMU still sticks to that. I know its a bit early, but if needed
> we should ask Peter to consider extending ms_mbind() to take a tid parameter
> too instead of working on current task by default.

Uh, what for? ms_mbind() works on the current process, not task.

> (*) memsched: An abstraction for representing coupling of threads with virtual
> address ranges. Threads and virtual address ranges of a memsched group are
> guaranteed (?) to be located on the same node.

Yeah, more or less so. We could relax that slightly to allow tasks to
run away from the node for very short periods of time, but basically
that's the provided guarantee.

  reply	other threads:[~2011-11-21 15:25 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-29 18:45 [Qemu-devel] [RFC PATCH] Exporting Guest RAM information for NUMA binding Bharata B Rao
2011-10-29 19:57 ` Alexander Graf
2011-10-29 19:57   ` [Qemu-devel] " Alexander Graf
2011-10-30  9:32   ` Vaidyanathan Srinivasan
2011-10-30  9:32     ` [Qemu-devel] " Vaidyanathan Srinivasan
2011-11-08 17:33   ` Chris Wright
2011-11-08 17:33     ` [Qemu-devel] " Chris Wright
2011-11-21 15:18     ` Bharata B Rao
2011-11-21 15:18       ` Bharata B Rao
2011-11-21 15:25       ` Peter Zijlstra [this message]
2011-11-21 15:25         ` Peter Zijlstra
2011-11-21 16:00         ` Bharata B Rao
2011-11-21 17:03           ` Peter Zijlstra
2011-11-21 17:03             ` [Qemu-devel] " Peter Zijlstra
2011-11-21 22:50             ` Chris Wright
2011-11-21 22:50               ` [Qemu-devel] " Chris Wright
2011-11-22  1:57               ` Anthony Liguori
2011-11-22  1:57                 ` Anthony Liguori
2011-11-22  1:51             ` Anthony Liguori
2011-11-22  1:51               ` Anthony Liguori
2011-11-23 15:03               ` Andrea Arcangeli
2011-11-23 15:03                 ` Andrea Arcangeli
2011-11-23 18:34                 ` Alexander Graf
2011-11-23 18:34                   ` Alexander Graf
2011-11-23 20:19                   ` Andrea Arcangeli
2011-11-23 20:19                     ` [Qemu-devel] " Andrea Arcangeli
2011-11-30 16:22                   ` Dipankar Sarma
2011-11-30 16:22                     ` Dipankar Sarma
2011-11-30 16:25                     ` Peter Zijlstra
2011-11-30 16:25                       ` [Qemu-devel] " Peter Zijlstra
2011-11-30 16:33                       ` Chris Wright
2011-11-30 16:33                         ` [Qemu-devel] " Chris Wright
2011-11-30 17:41                     ` Andrea Arcangeli
2011-11-30 17:41                       ` [Qemu-devel] " Andrea Arcangeli
2011-12-01 17:25                       ` Dipankar Sarma
2011-12-01 17:25                         ` Dipankar Sarma
2011-12-01 17:36                         ` Andrea Arcangeli
2011-12-01 17:36                           ` [Qemu-devel] " Andrea Arcangeli
2011-12-01 17:49                           ` Dipankar Sarma
2011-12-01 17:49                             ` Dipankar Sarma
2011-12-01 17:40                 ` Peter Zijlstra
2011-12-01 17:40                   ` Peter Zijlstra
2011-12-22 11:01                   ` Marcelo Tosatti
2011-12-22 11:01                     ` Marcelo Tosatti
2011-12-22 17:13                     ` Anthony Liguori
2011-12-22 17:13                       ` Anthony Liguori
2011-12-22 17:55                       ` Marcelo Tosatti
2011-12-22 17:55                         ` Marcelo Tosatti
2011-12-22 19:04                     ` Peter Zijlstra
2011-12-22 19:04                       ` [Qemu-devel] " Peter Zijlstra
2011-12-22 11:24                   ` Marcelo Tosatti
2011-12-22 11:24                     ` [Qemu-devel] " Marcelo Tosatti
2011-11-21 18:03         ` Avi Kivity
2011-11-21 18:03           ` [Qemu-devel] " Avi Kivity
2011-11-21 19:31           ` Peter Zijlstra
2011-11-21 19:31             ` Peter Zijlstra

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=1321889126.28118.5.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=aarcange@redhat.com \
    --cc=agraf@suse.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=chrisw@sous-sol.org \
    --cc=dipankar@in.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=svaidy@in.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.