All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Andre Przywara <andre.przywara@amd.com>
Cc: qemu-devel@nongnu.org, Andre Przywara <aprzywar@amd.com>
Subject: [Qemu-devel] Re: [PATCH 1/4] added -numa cmdline parameter parser
Date: Tue, 31 Mar 2009 08:42:58 -0500	[thread overview]
Message-ID: <49D21DE2.4030008@codemonkey.ws> (raw)
In-Reply-To: <1238506137-9140-2-git-send-email-andre.przywara@amd.com>

Andre Przywara wrote:
> diff --git a/sysemu.h b/sysemu.h
> index 3eab34b..b83a66c 100644
> --- a/sysemu.h
> +++ b/sysemu.h
> @@ -108,6 +108,11 @@ extern const char *bootp_filename;
>  extern int kqemu_allowed;
>  #endif
>  
> +#define MAX_NODES 64
> +extern int nb_numa_nodes;
> +extern uint64_t node_mem[MAX_NODES];
>   

Using ram_addr_t would be better here although ram_addr_t is just a 
uint64_t so it's not a big deal.

> +extern uint64_t node_cpumask[MAX_NODES];
>   

This is going to cause some pain because it won't be long before someone 
wants to support more than 64 cpus.  I think there are two 
possibilities.  We could go the cpuset route and introduce a type with 
special accessors to store a CPU bitmap.

Or, we could rely on the property that each CPU can only be part of one 
node and make the node association part of the CPUState.  If for some 
reason it's necessary to enumerate all of the CPUs for a given node, we 
would have to walk the CPU list to get at that information.  I don't 
think that'll be a common thing though.

> +static void numa_add(const char* optarg)
> +{
> +char option[128];
> +char *endptr;
> +unsigned long long value, endvalue;
> +int nodenr;
>   

That doesn't seem right indent-wise.

> +        /* assigning the VCPUs round-robin is easier to implement, guest OSes
> +         * must cope with this anyway, because there are BIOSes out there in
> +         * real machines which also use this scheme.
> +         */
> +        if (i == nb_numa_nodes) {
> +            for (i = 0; i < smp_cpus; i++) {
> +                node_cpumask[i % nb_numa_nodes] |= 1<<i;
> +            }
> +        }
>   

The only thing that I don't like about this is that I don't think the 
current -numa syntax can be used to describe a round-robin allocation.  
IIUC, you can say -numa cpus=3 or -numa cpus=3-4 but there's no way to 
say -numa cpus=3:5.

That means that if we ever change the default behavior, there's no way 
that a management app could recreate the guest with that particular 
topology (think live migration).

Regards,

Anthony Liguori

  parent reply	other threads:[~2009-03-31 13:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 13:28 [Qemu-devel] [PATCH 0/4] add NUMA emulation Andre Przywara
2009-03-31 13:28 ` [Qemu-devel] [PATCH 1/4] added -numa cmdline parameter parser Andre Przywara
2009-03-31 13:28   ` [Qemu-devel] [PATCH 2/4] add info numa command to monitor Andre Przywara
2009-03-31 13:28     ` [Qemu-devel] [PATCH 3/4] sending NUMA topology to BIOS Andre Przywara
2009-03-31 13:28       ` [Qemu-devel] [PATCH 4/4] add BIOS support for an ACPI SRAT table (needed for NUMA support) Andre Przywara
2009-03-31 13:44         ` [Qemu-devel] " Anthony Liguori
2009-03-31 20:04           ` [Qemu-devel] [PATCH 4/4] add SRAT ACPI table support Andre Przywara
2009-03-31 16:00       ` [Qemu-devel] [PATCH 3/4] sending NUMA topology to BIOS Blue Swirl
2009-03-31 21:33         ` Andre Przywara
2009-03-31 13:42   ` Anthony Liguori [this message]
2009-03-31 20:34     ` [Qemu-devel] Re: [PATCH 1/4] added -numa cmdline parameter parser Andre Przywara
2009-03-31 14:37 ` [Qemu-devel] Re: [PATCH 0/4] add NUMA emulation Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2009-04-21 11:02 [Qemu-devel] [PATCH 0/4] v3: " Andre Przywara
2009-04-21 11:02 ` [Qemu-devel] [PATCH 1/4] added -numa cmdline parameter parser Andre Przywara
2009-04-21 22:32   ` [Qemu-devel] " Anthony Liguori

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=49D21DE2.4030008@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=andre.przywara@amd.com \
    --cc=aprzywar@amd.com \
    --cc=qemu-devel@nongnu.org \
    /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.