qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: pbonzini@redhat.com, david@gibson.dropbear.id.au,
	qemu-devel@nongnu.org, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info
Date: Mon, 15 Jun 2015 18:34:56 +0530	[thread overview]
Message-ID: <20150615130456.GC30238@in.ibm.com> (raw)
In-Reply-To: <20150615111759.32b66fc6@nial.brq.redhat.com>

On Mon, Jun 15, 2015 at 11:17:59AM +0200, Igor Mammedov wrote:
> On Fri, 12 Jun 2015 14:30:26 +0530
> Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:
> 
> > Start storing the (start_addr, size, nodeid) of the pc-dimm memory
> > in numa_info so that this information can be used to lookup
> > node by address.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> >  hw/mem/pc-dimm.c      |  4 ++++
> >  include/sysemu/numa.h | 10 ++++++++++
> >  numa.c                | 26 ++++++++++++++++++++++++++
> >  3 files changed, 40 insertions(+)
> > 
> > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
> > index 98971b7..bb04862 100644
> > --- a/hw/mem/pc-dimm.c
> > +++ b/hw/mem/pc-dimm.c
> > @@ -97,6 +97,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,
> >  
> >      memory_region_add_subregion(&hpms->mr, addr - hpms->base, mr);
> >      vmstate_register_ram(mr, dev);
> > +    numa_set_mem_node_id(addr, memory_region_size(mr), dimm->node);
> >  
> >  out:
> >      error_propagate(errp, local_err);
> > @@ -105,6 +106,9 @@ out:
> >  void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms,
> >                             MemoryRegion *mr)
> >  {
> > +    PCDIMMDevice *dimm = PC_DIMM(dev);
> > +
> > +    numa_unset_mem_node_id(dimm->addr, memory_region_size(mr), dimm->node);
> Wouldn't that cause pc-dimm range appear in SRAT table?

I don't think so.

numa_set_mem_node_id() and numa_unset_mem_node_id() APIs store/remove
address range and node id information of realized pc-dimm device in/from a
linked list in numa_info structure so that we can lookup the node id for a
given address from numa.c in a self-contained manner.

So unless I am missing something, I don't see this affecting ACPI/SRAT
table in any way.

> Before this pc-dimm-s are only added as ACPI devices but don't
> advertised in SRAT ACPI table.
> 
> Perhaps make it up to target to decide if it want's to
> report dimms with numa_unset_mem_node_id() and not in generic code.

Regards,
Bharata.

  reply	other threads:[~2015-06-15 13:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12  9:00 [Qemu-devel] [RFC PATCH v1 0/4] Refactoring pc_dimm_plug and NUMA node lookup API Bharata B Rao
2015-06-12  9:00 ` [Qemu-devel] [RFC PATCH v1 1/4] pc, pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate routine Bharata B Rao
2015-06-15  6:32   ` David Gibson
2015-06-12  9:00 ` [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info Bharata B Rao
2015-06-15  6:34   ` David Gibson
2015-06-15  9:17   ` Igor Mammedov
2015-06-15 13:04     ` Bharata B Rao [this message]
2015-06-12  9:00 ` [Qemu-devel] [RFC PATCH v1 3/4] numa: Store boot memory address range in node_info Bharata B Rao
2015-06-15  6:35   ` David Gibson
2015-06-15 16:31   ` Eduardo Habkost
2015-06-17  3:17     ` Bharata B Rao
2015-06-12  9:00 ` [Qemu-devel] [RFC PATCH v1 4/4] numa: API to lookup NUMA node by address Bharata B Rao
2015-06-15  6:35   ` David Gibson

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=20150615130456.GC30238@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.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 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).