From: Thomas Gleixner <tglx@linutronix.de>
To: Saravana Kannan <saravanak@google.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v1] cpu/suspend: Do a partial hotplug during suspend
Date: Wed, 11 Dec 2024 19:45:10 +0100 [thread overview]
Message-ID: <87bjxiawjt.ffs@tglx> (raw)
In-Reply-To: <CAGETcx_wv_sC+FhChr8OaV6wjkHxTf9W66AoBQihV=m70G=_iQ@mail.gmail.com>
On Wed, Nov 20 2024 at 13:02, Saravana Kannan wrote:
> On Wed, Nov 20, 2024 at 12:42 AM Peter Zijlstra <peterz@infradead.org> wrote:
> I was thinking before CPUHP_BP_PREPARE_DYN because I saw some drivers
> doing whatever the heck they do in CPUHP_BP_PREPARE_DYN. It'll be much
> easier to do audits of non-dynamic stuff and keep it within
> requirements.
>
>> WORKQUEUE_PREP seems awefully random, and the
>> typical purpose of the _PREPARE stages is to allocate memory/resources
>> such that STARTING can do its thing, similarly _DEAD is about freeing
>> resources that got unused during _DYING.
>
> Yeah, I understood all this. I wanted to pick CPUHP_TMIGR_PREPARE
> (mentioned in my first email) because it was right before
> CPUHP_BP_PREPARE_DYN (and if you skip over CPUHP_MIPS_SOC_PREPARE
> which sounds like a hardware step). But hrtimers seem to have a bug --
> if the sequence fails anywhere in between CPUHP_AP_HRTIMERS_DYING and
> CPUHP_HRTIMERS_PREPARE things fail badly.
Yes, that's known and someone is working on it. Here is the thread:
https://lore.kernel.org/all/87wmg9oyzk.ffs@tglx
> So, for now I'd say we get in something like CPUHP_SUSPEND wherever it
> works right now (after WORKQUEUE_PREP) and slowly move it up till we
> get it right before CPUHP_BP_PREPARE_DYN.
>
>> So the most logical setup would be to skip the entire _DEAD/_PREPARE
>> cycle.
>
> Makes sense to me.
>
> On a separate note, I'm kinda confused by state machine stages where
> only one of the startup/teardown callbacks are set up. For example,
> I'd think the workqueue_prepare_cpu() would be combined with
> workqueue_online_cpu()/workqueue_offline_cpu(). Why is online() not
> sufficient to undo whatever offline() did?
Some of this is purely historical and was more or less blindly converted
from the original notifier chains.
Other things are one-off initializations to allocate and initialize
memory, which is never freed again under the assumption that the CPUs
will come back online.
But yes, this needs to be looked at on a state by state basis.
Thanks,
tglx
prev parent reply other threads:[~2024-12-11 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 2:05 [RFC PATCH v1] cpu/suspend: Do a partial hotplug during suspend Saravana Kannan
2024-11-19 9:28 ` Peter Zijlstra
2024-11-20 2:28 ` Saravana Kannan
2024-11-20 8:42 ` Peter Zijlstra
2024-11-20 21:02 ` Saravana Kannan
2024-12-11 18:45 ` Thomas Gleixner [this message]
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=87bjxiawjt.ffs@tglx \
--to=tglx@linutronix.de \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=saravanak@google.com \
/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