public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Elliot Berman <quic_eberman@quicinc.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Thomas Gleixner <tglx@linutronix.de>,
	<kernel@quicinc.com>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	"Prakash Viswalingam" <quic_prakashv@quicinc.com>
Subject: Re: [PATCH v2] freezer,sched: Use saved_state to reduce some spurious wakeups
Date: Mon, 4 Sep 2023 20:59:03 -0700	[thread overview]
Message-ID: <df61af06-a43e-05c5-66e8-5a68b08ff14b@quicinc.com> (raw)
In-Reply-To: <20230904212324.GA2568@noisy.programming.kicks-ass.net>



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

  reply	other threads:[~2023-09-05 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 17:42 [PATCH v2] freezer,sched: Use saved_state to reduce some spurious wakeups Elliot Berman
2023-09-04 21:23 ` Peter Zijlstra
2023-09-05  3:59   ` Elliot Berman [this message]
2023-09-07  9:46     ` Peter Zijlstra
2023-09-08 20:08       ` Elliot Berman
2023-09-08 22:08         ` Peter Zijlstra
2023-09-08 22:30           ` Elliot Berman
2023-09-08 22:48             ` Peter Zijlstra
2023-09-08 23:17               ` Elliot Berman
2023-09-09  9:29                 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df61af06-a43e-05c5-66e8-5a68b08ff14b@quicinc.com \
    --to=quic_eberman@quicinc.com \
    --cc=kernel@quicinc.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=quic_prakashv@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox