[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpo=0E4mR3FLJwuZ=6LbGMg7zQUZhnzjBKfm3ohSTw=p5Uw@mail.gmail.com>
Date: Tue, 30 Jul 2013 14:39:30 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
Cc: rjw@...k.pl, toralf.foerster@....de, robert.jarzmik@...el.com,
durgadoss.r@...el.com, tianyu.lan@...el.com,
lantianyu1986@...il.com, dirk.brandewie@...il.com,
stern@...land.harvard.edu, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/7] cpufreq: Preserve policy structure across suspend/resume
On 30 July 2013 04:25, Srivatsa S. Bhat
<srivatsa.bhat@...ux.vnet.ibm.com> wrote:
> To perform light-weight cpu-init and teardown in the cpufreq subsystem
> during suspend/resume, we need to separate out the 2 main functionalities
> of the cpufreq CPU hotplug callbacks, as outlined below:
>
> 1. Init/tear-down of core cpufreq and CPU-specific components, which are
> critical to the correct functioning of the cpufreq subsystem.
>
> 2. Init/tear-down of cpufreq sysfs files during suspend/resume.
>
> The first part requires accurate updates to the policy structure such as
> its ->cpus and ->related_cpus masks, whereas the second part requires that
> the policy->kobj structure is not released or re-initialized during
> suspend/resume.
>
> To handle both these requirements, we need to allow updates to the policy
> structure throughout suspend/resume, but prevent the structure from getting
> freed up. Also, we must have a mechanism by which the cpu-up callbacks can
> restore the policy structure, without allocating things afresh. (That also
> helps avoid memory leaks).
>
> To achieve this, we use 2 schemes:
> a. Use a fallback per-cpu storage area for preserving the policy structures
> during suspend, so that they can be restored during resume appropriately.
>
> b. Use the 'frozen' flag to determine when to free or allocate the policy
> structure vs when to restore the policy from the saved fallback storage.
> Thus we can successfully preserve the structure across suspend/resume.
>
> Effectively, this helps us complete the separation of the 'light-weight'
> and the 'full' init/tear-down sequences in the cpufreq subsystem, so that
> this can be made use of in the suspend/resume scenario.
>
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
> ---
>
> drivers/cpufreq/cpufreq.c | 69 +++++++++++++++++++++++++++++++++++----------
> 1 file changed, 53 insertions(+), 16 deletions(-)
>
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists