summaryrefslogtreecommitdiffstats
path: root/usr.bin/cpuset
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-12 23:54:40 +0000
committerjeff <jeff@FreeBSD.org>2008-03-12 23:54:40 +0000
commit90cc368fe8d8875af227ffe20907bc15e7c6d2af (patch)
tree3d21cbaea7c437eaa6537a6a2129d9176b0f0815 /usr.bin/cpuset
parentba621be3a9afcd65df9674a521af784165a5b950 (diff)
downloadFreeBSD-src-90cc368fe8d8875af227ffe20907bc15e7c6d2af.zip
FreeBSD-src-90cc368fe8d8875af227ffe20907bc15e7c6d2af.tar.gz
- When running a new command cause cpuset to operate on the per-thread mask
by default rather than the setmask. This is consistent with the linux tool and more consistent with the notion that the default level is the process level. The cpuset mask can still be modified by specifying the -c option. You can not set the per-thread and cpuset mask in a single command. - Update the man page to reflect this change. Contributed by: gallatin
Diffstat (limited to 'usr.bin/cpuset')
-rw-r--r--usr.bin/cpuset/cpuset.18
-rw-r--r--usr.bin/cpuset/cpuset.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/cpuset/cpuset.1 b/usr.bin/cpuset/cpuset.1
index 00f9e81..b97234a 100644
--- a/usr.bin/cpuset/cpuset.1
+++ b/usr.bin/cpuset/cpuset.1
@@ -89,8 +89,12 @@ queried using
When running a command it may join a set specified with
.Fl s
otherwise a new set is created.
-In addition, a mask for the set may be specified using
+In addition, a mask for the command may be specified using
.Fl l .
+When used in conjunction with
+.Fl c
+the mask modifies the supplied or created set rather than the private mask
+for the thread.
.Pp
The options are as follows:
.Bl -tag -width ".Fl l Ar cpu-list"
@@ -127,7 +131,7 @@ Specifies a thread id as the target of the operation.
Create a new group with CPUs 0-4 inclusive and run
.Pa /bin/sh
on it:
-.Dl cpuset -l 0-4 /bin/sh
+.Dl cpuset -c -l 0-4 /bin/sh
.Pp
Query the mask of CPUs the
.Aq sh pid
diff --git a/usr.bin/cpuset/cpuset.c b/usr.bin/cpuset/cpuset.c
index 41a715d..c31ebb7 100644
--- a/usr.bin/cpuset/cpuset.c
+++ b/usr.bin/cpuset/cpuset.c
@@ -257,7 +257,7 @@ main(int argc, char *argv[])
* The user wants to run a command with a set and possibly cpumask.
*/
if (argc) {
- if (pflag | rflag | tflag || cflag)
+ if (pflag | rflag | tflag)
usage();
if (sflag) {
if (cpuset_setid(CPU_WHICH_PID, -1, setid))
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
err(argc, "newid");
}
if (lflag) {
- if (cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID,
+ if (cpuset_setaffinity(level, CPU_WHICH_PID,
-1, sizeof(mask), &mask) != 0)
err(EXIT_FAILURE, "setaffinity");
}
OpenPOWER on IntegriCloud