linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] numactl: new --allphyscpubind/-A option
@ 2013-09-05 14:14 Petr Holasek
  2013-09-05 16:45 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Holasek @ 2013-09-05 14:14 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: linux-numa, Petr Holasek

This patch adds new --allphyscpubind/-A option to set cpu bind to all possible
physical CPUs, not only to ones from the current cpuset as --physcpubind does
now.

We have discussed this topic about year ago here:

http://thread.gmane.org/gmane.linux.kernel.numa/798

best regards,
Petr H
---
 numactl-2.0.9-rc3/numactl.8 |  9 +++++++++
 numactl-2.0.9-rc3/numactl.c | 11 ++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/numactl-2.0.9-rc3/numactl.8 b/numactl-2.0.9-rc3/numactl.8
index 576cdb6..197a43b 100644
--- a/numactl-2.0.9-rc3/numactl.8
+++ b/numactl-2.0.9-rc3/numactl.8
@@ -33,6 +33,8 @@ numactl \- Control NUMA policy for processes or shared memory
 ] [
 .B \-\-physcpubind cpus
 ] [
+.B \-\-allphyscpubind cpus
+] [
 .B \-\-localalloc
 ] [\-\-] command {arguments ...}
 .br
@@ -152,6 +154,13 @@ current cpuset.
 A !N-N notation indicates the inverse of N-N, in other words all cpus
 except N-N.  If used with + notation, specify !+N-N.
 .TP
+.B \-\-allphyscpubind=cpus, \-A cpus
+Same as
+.I \-\-physcpubind
+but can bind
+.I process
+to all available physical CPUs, not only to CPUs from the current cpuset.
+.TP
 .B \-\-localalloc, \-l 
 Always allocate on the current node.
 .TP
diff --git a/numactl-2.0.9-rc3/numactl.c b/numactl-2.0.9-rc3/numactl.c
index e1d5487..afb883a 100755
--- a/numactl-2.0.9-rc3/numactl.c
+++ b/numactl-2.0.9-rc3/numactl.c
@@ -37,6 +37,7 @@ struct option opts[] = {
 	{"cpubind", 1, 0, 'c' },
 	{"cpunodebind", 1, 0, 'N' },
 	{"physcpubind", 1, 0, 'C' },
+	{"allphyscpubind", 1, 0, 'A'},
 	{"membind", 1, 0, 'm'},
 	{"show", 0, 0, 's' },
 	{"localalloc", 0,0, 'l'},
@@ -61,7 +62,7 @@ void usage(void)
 {
 	fprintf(stderr,
 		"usage: numactl [--interleave= | -i <nodes>] [--preferred= | -p <node>]\n"
-		"               [--physcpubind= | -C <cpus>] [--cpunodebind= | -N <nodes>]\n"
+		"               [--allphyscpubind= | -A <cpus>] [--physcpubind= | -C <cpus>] [--cpunodebind= | -N <nodes>]\n"
 		"               [--membind= | -m <nodes>] [--localalloc | -l] command args ...\n"
 		"       numactl [--show | -s]\n"
 		"       numactl [--hardware | -H]\n"
@@ -443,10 +444,14 @@ int main(int ac, char **av)
 			checkerror("sched_setaffinity");
 			break;
 		case 'C': /* --physcpubind */
+		case 'A': /* --allphyscpubind */
 		{
 			struct bitmask *cpubuf;
-			dontshm("-C/--physcpubind");
-			cpubuf = numa_parse_cpustring(optarg);
+			dontshm("-C/--physcpubind/-A/--allphyscpubind");
+			if (c == 'C')
+				cpubuf = numa_parse_cpustring(optarg);
+			else
+				cpubuf = numa_parse_cpustring_all(optarg);
 			if (!cpubuf) {
 				printf ("<%s> is invalid\n", optarg);
 				usage();
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] numactl: new --allphyscpubind/-A option
  2013-09-05 14:14 [PATCH] numactl: new --allphyscpubind/-A option Petr Holasek
@ 2013-09-05 16:45 ` Andi Kleen
  2013-09-05 19:54   ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2013-09-05 16:45 UTC (permalink / raw)
  To: Petr Holasek; +Cc: Cliff Wickman, linux-numa

On Thu, Sep 05, 2013 at 04:14:11PM +0200, Petr Holasek wrote:
> This patch adds new --allphyscpubind/-A option to set cpu bind to all possible
> physical CPUs, not only to ones from the current cpuset as --physcpubind does
> now.
> 
> We have discussed this topic about year ago here:
> 
> http://thread.gmane.org/gmane.linux.kernel.numa/798

Patch looks good to me.

-Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] numactl: new --allphyscpubind/-A option
  2013-09-05 16:45 ` Andi Kleen
@ 2013-09-05 19:54   ` Andi Kleen
  0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2013-09-05 19:54 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Petr Holasek, Cliff Wickman, linux-numa

On Thu, Sep 05, 2013 at 06:45:11PM +0200, Andi Kleen wrote:
> On Thu, Sep 05, 2013 at 04:14:11PM +0200, Petr Holasek wrote:
> > This patch adds new --allphyscpubind/-A option to set cpu bind to all possible
> > physical CPUs, not only to ones from the current cpuset as --physcpubind does
> > now.
> > 
> > We have discussed this topic about year ago here:
> > 
> > http://thread.gmane.org/gmane.linux.kernel.numa/798
> 
> Patch looks good to me.

Actually on second thought a separate --all argument that 
disables cpusets for everything would be better.

-Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-05 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 14:14 [PATCH] numactl: new --allphyscpubind/-A option Petr Holasek
2013-09-05 16:45 ` Andi Kleen
2013-09-05 19:54   ` Andi Kleen

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).