Re: [PATCH] selftests: cpufreq: stop CPU hotplug loop after cpufreq update test

From: Viresh Kumar

Date: Mon Oct 12 2026 - 00:27:15 EST


On 10-10-26, 18:01, xiong yining wrote:
> Original test uses a fixed 5000 iteration loop to trigger CPU hotplug
> for verifying cpufreq synchronization between CPU hotplug and sysfs
> writes.
>
> Two issues exist:
> 1. Background hotplug task keeps running after test completes, causing
> redundant CPU on/offline operations.
> 2. When cpufreq frequency setup is slow, the hotplug loop may exit
> before frequency updates finish, which breaks test purpose.
>
> Introduce a file-based stop flag to control the infinite hotplug loop.
> After all cpufreq updates complete, create the stop flag file and
> wait for the hotplug task to exit.
>
> This makes hotplug run only during cpufreq sysfs write test,
> align with test objective.
>
> Signed-off-by: xiong yining <xiongyining1480@xxxxxxxxxxxxxx>
> ---
> tools/testing/selftests/cpufreq/special-tests.sh | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

--
viresh