[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df61af06-a43e-05c5-66e8-5a68b08ff14b@quicinc.com>
Date: Mon, 4 Sep 2023 20:59:03 -0700
From: Elliot Berman <quic_eberman@...cinc.com>
To: Peter Zijlstra <peterz@...radead.org>
CC: Ingo Molnar <mingo@...hat.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Pavel Machek <pavel@....cz>,
Thomas Gleixner <tglx@...utronix.de>, <kernel@...cinc.com>,
<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-pm@...r.kernel.org>,
"Prakash Viswalingam" <quic_prakashv@...cinc.com>
Subject: Re: [PATCH v2] freezer,sched: Use saved_state to reduce some spurious
wakeups
On 9/4/2023 2:23 PM, Peter Zijlstra wrote:
> On Wed, Aug 30, 2023 at 10:42:39AM -0700, Elliot Berman wrote:
>
>> Avoid the spurious wakeups by saving the state of TASK_FREEZABLE tasks.
>> If the task was running before entering TASK_FROZEN state
>> (__refrigerator()) or if the task received a wake up for the saved
>> state, then the task is woken on thaw. saved_state from PREEMPT_RT locks
>> can be re-used because freezer would not stomp on the rtlock wait flow:
>> TASK_RTLOCK_WAIT isn't considered freezable.
>
> You don't actually assert that anywhere I think, so the moment someone
> makes that happen you crash and burn.
>
I can certainly add an assertion on the freezer side.
> Also:
>
>> -#ifdef CONFIG_PREEMPT_RT
>> +#if IS_ENABLED(CONFIG_PREEMPT_RT) || IS_ENABLED(CONFIG_FREEZER)
>
> That makes wakeup more horrible for everyone :/
I don't think the hot wakeup path is significantly impacted because the
added checks come after the hot path is already not taken.
wait_task_inactive() is impacted in the case of contention on pi_lock,
but I don't think that is part of any hot path.
I'll run some further tests on my end to be sure about the wake up
latency. Are there any benchmarks/tests you like for measuring the hot
path? I can run those as well.
Thanks,
Elliot
Powered by blists - more mailing lists