Re: [PATCH] tick-sched: fix idle and iowait sleeptime accounting vs CPU hotplug

From: Tim Chen
Date: Mon Jan 22 2024 - 13:54:37 EST


On Mon, 2024-01-15 at 17:35 +0100, Heiko Carstens wrote:
>
>
> + idle_sleeptime = ts->idle_sleeptime;
> + iowait_sleeptime = ts->iowait_sleeptime;
> memset(ts, 0, sizeof(*ts));
> + ts->idle_sleeptime = idle_sleeptime;
> + ts->iowait_sleeptime = iowait_sleeptime;
> }

Should idle_calls and idle_sleeps be preserved and
restored too?  

Seems like if we preserve the
idle_sleeptime, and wish to compute the average
sleep time per sleep, we will need to know the value of
idle_sleeps that's also preserved across CPU offline/online.

Tim