numactl: new --allphyscpubind/-A option
PATCH 1/1 numactl: new --allphyscpubind/-A option
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(-)
numactl-2.0.9-rc3/numactl.8 +9 -0
@@ -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
numactl-2.0.9-rc3/numactl.c +8 -3
@@ -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 ();
Signature · 1 line
1.8.1.4
Quoted 7 lines · 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:
Patch looks good to me.
-Andi
Quoted 10 lines · Andi Kleen
Quoted 7 lines · 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:
Patch looks good to me.
Actually on second thought a separate --all argument that disables cpusets for everything would be better.
-Andi