All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Marcus Granado <Marcus.Granado@eu.citrix.com>,
	Dan Magenheimer <dan.magenheimer@oracle.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Anil Madhavapeddy <anil@recoil.org>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Juergen Gross <juergen.gross@ts.fujitsu.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Matt Wilson <msw@amazon.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH 02 of 11 v5] xen, libxc: introduce xc_nodemap_t
Date: Wed, 10 Apr 2013 18:41:14 +0200	[thread overview]
Message-ID: <1365612074.13103.139.camel@Solace> (raw)
In-Reply-To: <5165AD0102000078000CC38B@nat28.tlf.novell.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1253 bytes --]

On mer, 2013-04-10 at 17:18 +0100, Jan Beulich wrote:
> > diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> > --- a/xen/common/domctl.c
> > +++ b/xen/common/domctl.c
> > @@ -117,6 +117,20 @@ int xenctl_bitmap_to_cpumask(cpumask_var
> >      return err;
> >  }
> >  
> > +int nodemask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_nodemap,
> > +                              const nodemask_t *nodemask)
> > +{
> > +    return bitmap_to_xenctl_bitmap(xenctl_nodemap, cpumask_bits(nodemask),
> 
> This can hardly be cpumask_bits(). If you don't have a similar node
> mask accessor already, you should create one rather than abusing
> the CPU mask one.
> 
Wow... Impressive it survived this late! :-/

There is one, it's nodes_addr(), I just have to use it here.

The patch attached to this mail does that, let me know if it looks
better/fine, as well as if it is fine to pick it up from here, or I have
to respin the whole series.

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.1.2: libxc-introduce-xc_nodemap_t --]
[-- Type: text/plain, Size: 2906 bytes --]

# HG changeset patch
# Parent 995f0b3d6c9bffb147137f850bf3fadffe735c3a
xen, libxc: introduce xc_nodemap_t

And its handling functions, following suit from xc_cpumap_t.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
Changes from v2:
 * Discriminating between statically allocated nodemask_t and
   dynamically allocated nodemask_var_t is not really necesssary,
   given the maximum number of nodes won't ever grow that much,
   so killed that hunk, as suggested during review.

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -54,6 +54,11 @@ int xc_get_cpumap_size(xc_interface *xch
     return (xc_get_max_cpus(xch) + 7) / 8;
 }
 
+int xc_get_nodemap_size(xc_interface *xch)
+{
+    return (xc_get_max_nodes(xch) + 7) / 8;
+}
+
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
 {
     int sz;
@@ -64,6 +69,16 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface
     return calloc(1, sz);
 }
 
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
+{
+    int sz;
+
+    sz = xc_get_nodemap_size(xch);
+    if (sz == 0)
+        return NULL;
+    return calloc(1, sz);
+}
+
 int xc_readconsolering(xc_interface *xch,
                        char *buffer,
                        unsigned int *pnr_chars,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -330,12 +330,20 @@ int xc_get_cpumap_size(xc_interface *xch
 /* allocate a cpumap */
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch);
 
- /*
+/*
  * NODEMAP handling
  */
+typedef uint8_t *xc_nodemap_t;
+
 /* return maximum number of NUMA nodes the hypervisor supports */
 int xc_get_max_nodes(xc_interface *xch);
 
+/* return array size for nodemap */
+int xc_get_nodemap_size(xc_interface *xch);
+
+/* allocate a nodemap */
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch);
+
 /*
  * DOMAIN DEBUGGING FUNCTIONS
  */
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -117,6 +117,20 @@ int xenctl_bitmap_to_cpumask(cpumask_var
     return err;
 }
 
+int nodemask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_nodemap,
+                              const nodemask_t *nodemask)
+{
+    return bitmap_to_xenctl_bitmap(xenctl_nodemap, nodes_addr(*nodemask),
+                                   MAX_NUMNODES);
+}
+
+int xenctl_bitmap_to_nodemask(nodemask_t *nodemask,
+                              const struct xenctl_bitmap *xenctl_nodemap)
+{
+    return xenctl_bitmap_to_bitmap(nodes_addr(*nodemask), xenctl_nodemap,
+                                   MAX_NUMNODES);
+}
+
 static inline int is_free_domid(domid_t dom)
 {
     struct domain *d;

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-04-10 16:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 16:04 [PATCH 00 of 11 v5] NUMA aware credit scheduling Dario Faggioli
2013-04-10 16:04 ` [PATCH 01 of 11 v5] xen, libxc: rename xenctl_cpumap to xenctl_bitmap Dario Faggioli
2013-04-10 16:05 ` [PATCH 02 of 11 v5] xen, libxc: introduce xc_nodemap_t Dario Faggioli
2013-04-10 16:18   ` Jan Beulich
2013-04-10 16:41     ` Dario Faggioli [this message]
2013-04-10 16:05 ` [PATCH 03 of 11 v5] xen: sched_credit: when picking, make sure we get an idle one, if any Dario Faggioli
2013-04-10 16:05 ` [PATCH 04 of 11 v5] xen: sched_credit: let the scheduler know about node-affinity Dario Faggioli
2013-04-10 16:05 ` [PATCH 05 of 11 v5] xen: allow for explicitly specifying node-affinity Dario Faggioli
2013-04-10 16:05 ` [PATCH 06 of 11 v5] libxc: " Dario Faggioli
2013-04-10 16:05 ` [PATCH 07 of 11 v5] libxl: " Dario Faggioli
2013-04-10 16:05 ` [PATCH 08 of 11 v5] libxl: optimize the calculation of how many VCPUs can run on a candidate Dario Faggioli
2013-04-10 16:05 ` [PATCH 09 of 11 v5] libxl: automatic placement deals with node-affinity Dario Faggioli
2013-04-10 16:05 ` [PATCH 10 of 11 v5] xl: add node-affinity to the output of `xl list` Dario Faggioli
2013-04-10 16:05 ` [PATCH 11 of 11 v5] docs: rearrange and update NUMA placement documentation Dario Faggioli
2013-04-11 12:41 ` [PATCH 00 of 11 v5] NUMA aware credit scheduling George Dunlap
2013-04-16  8:44   ` Dario Faggioli
2013-04-16 12:16     ` George Dunlap
2013-04-16 13:14       ` Jan Beulich
2013-04-16 14:47         ` Dario Faggioli
2013-04-16 14:57           ` Ian Campbell
2013-04-16 15:01             ` Dario Faggioli
2013-04-16 15:22         ` George Dunlap
2013-04-16 15:49           ` Ian Jackson
2013-04-16 16:07             ` Dario Faggioli
2013-04-16 16:12               ` Ian Jackson
2013-04-17  8:53               ` Ian Campbell
2013-04-17  8:56                 ` Dario Faggioli
2013-04-17  8:59                   ` Ian Campbell
2013-04-17  9:11                     ` Dario Faggioli
2013-04-16 16:06           ` Ian Campbell
2013-04-16 16:06           ` Jan Beulich
2013-04-16 16:45         ` Keir Fraser
2013-04-16 17:03           ` Dario Faggioli

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=1365612074.13103.139.camel@Solace \
    --to=dario.faggioli@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Marcus.Granado@eu.citrix.com \
    --cc=anil@recoil.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=juergen.gross@ts.fujitsu.com \
    --cc=msw@amazon.com \
    --cc=xen-devel@lists.xen.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.