diff options
| author | Sean Christopherson <seanjc@google.com> | 2026-07-07 08:07:05 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-07-10 09:06:36 -0700 |
| commit | 3f339b70bb59d92d81d2853f905e1124276a9802 (patch) | |
| tree | 48fc2ef399b6cb2b1a4e5410b6e2f140a4b11993 /tools/perf/scripts/python/stackcollapse.py | |
| parent | a204badd8432f93b7e862e7dac6db0fe3d65f370 (diff) | |
KVM: selftests: Drop superfluous use of pthread_attr_setaffinity_np()
In the steal time test, don't explicitly set the CPU affinity mask of the
worker child and instead rely on the child inheriting the affinity of the
main thread. Per the pthread_create()[1] and pthread_setaffinity_np()[2]
documentation, new threads inherit the parent's affinity mask.
Linux-specific details
The new thread inherits copies of the calling thread's capability
sets (see capabilities(7)) and CPU affinity mask (see
sched_setaffinity(2)).
Out of an abundance of caution, assert that the child did indeed inherit
the CPU affinity mask, as the test will hang indefinitely if the system is
under light load.
Dropping use of pthread_attr_setaffinity_np() allows building the steal
time test against non-glibc C libraries that don't implement that GNU
extension.
Link: https://man7.org/linux/man-pages/man3/pthread_setaffinity_np.3.html [1]
Link: https://man7.org/linux/man-pages/man3/pthread_create.3.html [1]
Cc: Hisam Mehboob <hisamshar@gmail.com>
Reported-by: Aqib Faruqui <aqibaf@amazon.com>
Closes: https://lore.kernel.org/all/20250829142556.72577-4-aqibaf@amazon.com
Link: https://patch.msgid.link/20260707150706.1198541-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
