Page MenuHomeFreeBSD

cpuset(8): move to /bin/
ClosedPublic

Authored by ngie on May 11 2023, 6:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 2:30 PM
Unknown Object (File)
Mon, Nov 25, 8:53 AM
Unknown Object (File)
Sun, Nov 24, 7:01 PM
Unknown Object (File)
Sat, Nov 23, 10:27 PM
Unknown Object (File)
Sat, Nov 23, 6:17 AM
Unknown Object (File)
Fri, Nov 22, 6:28 AM
Unknown Object (File)
Wed, Nov 20, 12:01 AM
Unknown Object (File)
Tue, Nov 19, 8:52 AM
Subscribers

Details

Summary

This change moves /usr/bin/cpuset to /bin/cpuset so it is more readily
available on hosts where the /usr partition might not be mounted at the
time / has been mounted.

Remove some complexity from rc.subr(8) since /bin is assumed to always
be present if/when / is mounted.

MFC after: 2 weeks
MFC with: 0661f93892a2, 271d552379af

Test Plan
  • Confirmed that cpuset(8) functions in the new location:
$ (set -x; cat ~/looper.sh; ~/looper.sh & )
+ cat /home/ngie/looper.sh
#!/bin/sh
while :; do sleep 1; done
+ /home/ngie/looper.sh
$ ps auxww | grep looper
ngie  44809   0.0  0.0 13408  3308  1  S    17:06      0:00.01 /bin/sh /home/ngie/looper.sh
ngie  44876   0.0  0.0 12840  2744  1  S+   17:07      0:00.00 grep looper
$ ls -l `which -a cpuset`
-r-xr-xr-x  1 root wheel 13000 Aug 10 16:24 /bin/cpuset
lrwxr-xr-x  1 root wheel    11 Aug 10 16:24 /usr/bin/cpuset -> /bin/cpuset
$ /bin/cpuset -g -p 44809
pid 44809 mask: 0, 1, 2, 3, 4, 5
pid 44809 domain policy: first-touch mask: 0
$ /usr/bin/cpuset -g -p 44809
pid 44809 mask: 0, 1, 2, 3, 4, 5
pid 44809 domain policy: first-touch mask: 0
$ pgrep sshd
856
$ sudo cpuset -g -p 856
pid 856 mask: 0, 1, 2, 3, 4, 5
pid 856 domain policy: first-touch mask: 0
$ sudo /usr/bin/cpuset -c -l 5 -p 856
$ sudo cpuset -g -p 856
pid 856 mask: 5
pid 856 domain policy: first-touch mask: 0
$ sudo cpuset -c -l 0-5 -p 856
$ sudo cpuset -g -p 856
pid 856 mask: 0, 1, 2, 3, 4, 5
pid 856 domain policy: first-touch mask: 0
  • Showed that the feature works with vmtoolsd:
$ sysrc vmware_guestd_cpuset
vmware_guestd_cpuset: 1-4
$ sudo service vmware-guestd quietrestart
...
$ sudo cpuset -g -p 49298
pid 49298 mask: 1, 2, 3, 4
pid 49298 domain policy: first-touch mask: 0
$ sudo sysrc -x vmware_guestd_cpuset
$ sysrc vmware_guestd_cpuset-default
vmware_guestd_cpuset-default: default
$ sudo service vmware-guestd quietrestart
...
$ sudo cpuset -g -p `pgrep vmtoolsd`
pid 50051 mask: 0, 1, 2, 3, 4, 5
pid 50051 domain policy: first-touch mask: 0
$

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ngie requested review of this revision.May 11 2023, 6:00 AM
ngie created this revision.
This revision is now accepted and ready to land.Aug 11 2023, 12:33 AM
This revision was automatically updated to reflect the committed changes.