ColinIanKing / stress-ng

This is the stress-ng upstream project git repository. stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.
https://github.com/ColinIanKing/stress-ng
GNU General Public License v2.0
1.82k stars 290 forks source link

stress-ng.1: --taskset is no longer Linux-specific #435

Closed chrfranke closed 1 month ago

chrfranke commented 1 month ago

man stress-ng says:

   --taskset list
          set CPU affinity based on the list of CPUs provided; stress-ng is bound to just use these CPUs
          (Linux only). ...

The check in the source uses HAVE_SCHED_SETAFFINITY instead of __linux__ which is good.

sched_setaffinity() is at least also provided by Cygwin (--taskset works as expected) and FreeBSD (not tested):

https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=641ecb0 https://cgit.freebsd.org/src/commit?id=43736b7

HAVE_SCHED_SETAFFINITY is used multiple times in the source, so other (Linux only) notes may also be affected.