mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	Patch Tracking <patches@linaro.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lan Tianyu <tianyu.lan@intel.com>, Nishanth Menon <nm@ti.com>,
	jinchoi@broadcom.com,
	Sebastian Capella <sebastian.capella@linaro.org>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Subject: Re: [PATCH] cpufreq: suspend/resume governors with PM notifiers
Date: Sun, 17 Nov 2013 02:08:40 +0100	[thread overview]
Message-ID: <6050176.zVNbf5pomE@vostro.rjw.lan> (raw)
In-Reply-To: <CAKohpok_zjdRVz5-ZGRmZtwysC7jORm2mgRbLWDUzo1ucYVKZg@mail.gmail.com>

On Saturday, November 16, 2013 08:47:24 PM Viresh Kumar wrote:
> On 16 November 2013 19:59, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> 
> > Well, disabling it for the whole duration of suspend/resume and/or hibernation
> > may not be the right approach entirely, unless we force the pax perf of the
> 
> s/pax/max ?

Yes.

> > boot CPU at least in addition to that.  Otherwise the latency of suspend and
> > the subsequent resume will depend on what perf level the CPUs where before
> > disabling the governors, which is not desirable at al.
> 
> Well that is pretty much doable.

Not necessarily on all CPU models.

> >> And these are the notifications that we send:
> >> - PM_HIBERNATION_PREPARE
> >> - PM_POST_HIBERNATION
> >> - PM_RESTORE_PREPARE
> >> - PM_POST_RESTORE
> >>
> >> If I am not wrong I need to stop governors on PM_HIBERNATION_PREPARE and need to
> >> start them back on: PM_POST_HIBERNATION (I am a bit confused with this one. Does
> >> this POST_HIBERNATION one happens at the end of going into hibernation? or after
> >> booting back? I need a notifier at the end of restore)..
> >
> > You'd need both PM_POST_HIBERNATION and PM_POST_RESTORE, but I wouldn't really
> > like cpufreq governors to be disabled throughout the whole hibernation.
> 
> So PM_POST_HIBERNATION is called just before shutting off the system? And
> PM_POST_RESTORE is called after system is resumed from saved image?

PM_POST_HIBERNATION is only called if there's an error during hibernation.
PM_POST_RESTORE is called as you said.

Also you have to remember that the _PREPARE PM notifiers are called before the
freezing of tasks when user space is still running, so disabling governors at
that point may lead to some weird behavior.

> > Actually, we use CPU offline/online during system suspend/resume to avoid
> > having to do stuff like this from PM notifiers.
> 
> I didn't get the logic behind this one..

If we have to do special stuff from PM notifiers for CPU "suspend", we will be
better off by doing something entirely special instead of CPU offline down the
road.  Which we may end up doing given the problems with frozen/not frozen in
the cpufreq core.

We may introduce suspend_noirq and resume_noirq for cpu_subsys, for example,
and handle things from there.  Or something similar.  But slapping PM notifiers
on top of the existing code just because it appears to be easy (and making that
code even more overdesigned than it already is this way) doesn't seem quite
right.

Now, the Tianyu's patch extends the Srivatsa's approach to governors, which
actually should have been done from the outset, so it is within the scope of
what we have already.  It may not solve all of the problems, but it still makes
some progress and has a little chance to introduce *new* problems at the same
time.

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-11-17  0:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 10:12 Viresh Kumar
2013-11-15 13:48 ` Nishanth Menon
2013-11-15 15:34   ` Viresh Kumar
2013-11-16  0:24 ` Rafael J. Wysocki
2013-11-16  4:31   ` viresh kumar
2013-11-16 14:29     ` Rafael J. Wysocki
2013-11-16 15:17       ` Viresh Kumar
2013-11-17  1:08         ` Rafael J. Wysocki [this message]
2013-11-17  8:22           ` viresh kumar
2013-11-17 15:09             ` Rafael J. Wysocki
2013-11-17 16:57               ` Viresh Kumar
2013-11-17 21:37                 ` Rafael J. Wysocki
2013-11-18  5:39                   ` viresh kumar
2013-11-18 10:57                     ` Lan Tianyu
2013-11-18 11:01                       ` Viresh Kumar
2013-11-18 13:37                         ` Lan Tianyu
2013-11-18 15:32                           ` Viresh Kumar
2013-11-21 14:39                           ` Rafael J. Wysocki
2013-11-20  5:34                     ` Viresh Kumar
2013-11-21  1:07                       ` Rafael J. Wysocki
2013-11-21 14:38                       ` Rafael J. Wysocki
2013-11-21 16:17                         ` Viresh Kumar
2013-11-21 22:14                           ` Rafael J. Wysocki
2013-11-22  9:11                             ` viresh kumar
2013-11-25  4:25                               ` Viresh Kumar
2013-11-25 11:35                                 ` Rafael J. Wysocki
2013-12-25 22:39           ` Pavel Machek
2013-12-26  0:56             ` Rafael J. Wysocki
2013-11-16  5:56 ` Lan Tianyu

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=6050176.zVNbf5pomE@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=cpufreq@vger.kernel.org \
    --cc=jinchoi@broadcom.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=patches@linaro.org \
    --cc=sebastian.capella@linaro.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tianyu.lan@intel.com \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®