[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241120084240.GA19989@noisy.programming.kicks-ass.net>
Date: Wed, 20 Nov 2024 09:42:40 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Saravana Kannan <saravanak@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, kernel-team@...roid.com,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v1] cpu/suspend: Do a partial hotplug during suspend
On Tue, Nov 19, 2024 at 06:28:00PM -0800, Saravana Kannan wrote:
> On Tue, Nov 19, 2024 at 1:28 AM Peter Zijlstra <peterz@...radead.org> wrote:
> > Well, if we push this one step further, why do we need hotplug at all?
> > Can't we just keep them up and idle?
> >
> > That is, if we look at suspend_enter(), you'll note that
> > PM_SUSPEND_TO_IDLE happens before the whole disable_secondary_cpus()
> > thing.
> >
> > So million-dollar question, can this pixel thing do suspend to idle?
>
> Unfortunately not. You saw my rant about firmware and s2idle bugs at
> LPC. But yes, I'm going my part towards pushing for s2idle over s2ram.
Right, so with Google doing their own chips, I think you stand a fair
chance of making it work 'soon', right? :-)
> And even if this Pixel could do it, there are a lot of devices in use
> today that will never get a firmware update to enable s2idle. So, why
> have all of them waste time and energy doing useless steps during
> suspend?
Right, so if we really want to go do this, we should add place-holder
state for suspend, something like CPUHP_SUSPEND and document the
requirements and audit all existing states now skipped to meet
requirements.
I think it should go somewhere right between CPUHP_BP_PREPARE_DYN_END
and CPUHP_BRINGUP_CPU. 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.
So the most logical setup would be to skip the entire _DEAD/_PREPARE
cycle.
> > Traditionally hybernate is the whole save-to-disk and power machine off
> > thing, and then there was suspend (to RAM) which was some dodgy as heck
> > BIOS thing (on x86) which required all non-boot CPUs to be 'dead'.
>
> My change would also help with the time it takes to power off the CPUs
> during hibernate :) If it'll work (otherwise, we can make sure this
> applies only to suspend).
So I'm not sure you can actually skip this during hibernate. The thing
is, we load the image from the boot CPU in a state where the secondary
CPUs have never yet been loaded up. It might be possible to skip the
DEAD/PREPARE cycle, but it would also mean the image must contain the
full PREPARE resources. So if it all works, then the result is a larger
image, for a slightly faster cycle, but since hibernate is already super
slow, I don't think this trade-off is worth it.
Powered by blists - more mailing lists