]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/power turbostat: Fix forked child affinity regression
authorLen Brown <len.brown@intel.com>
Mon, 27 Jan 2025 22:42:19 +0000 (16:42 -0600)
committerLen Brown <len.brown@intel.com>
Mon, 27 Jan 2025 22:56:51 +0000 (16:56 -0600)
commitb32c36975da48afc9089f8b61f7b2dcc40e479d2
treed628f4f0beb4177c13a5d7357b6bad3ada626b52
parent1a202afeaa370970413846c2cb09b383875e753c
tools/power turbostat: Fix forked child affinity regression

In "one-shot" mode, turbostat
1. takes a counter snapshot
2. forks and waits for a child
3. takes the end counter snapshot and prints the result.

But turbostat counter snapshots currently use affinity to travel
around the system so that counter reads are "local", and this
affinity must be cleared between #1 and #2 above.

The offending commit removed that reset that allowed the child
to run on cpu_present_set.

Fix that issue, and improve upon the original by using
cpu_possible_set for the child.  This allows the child
to also run on CPUs that hotplug online during its runtime.

Reported-by: Zhang Rui <rui.zhang@intel.com>
Fixes: 7bb3fe27ad4f ("tools/power/turbostat: Obey allowed CPUs during startup")
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c