linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: viresh kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
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 13:52:15 +0530	[thread overview]
Message-ID: <52887CB7.4000108@linaro.org> (raw)
In-Reply-To: <6050176.zVNbf5pomE@vostro.rjw.lan>

On Sunday 17 November 2013 06:38 AM, Rafael J. Wysocki wrote:
> On Saturday, November 16, 2013 08:47:24 PM Viresh Kumar wrote:
>> Well that is pretty much doable.
> 
> Not necessarily on all CPU models.

Okay.. Just for my understanding, why?

>> 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.

Ahh I see. Thanks.

> 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 good point. I haven't thought about it earlier.

And when I see what bad can happen, I couldn't find much. The worst is that we
wouldn't go to a frequency requested by userspace daemon. But we wouldn't send
an error then. But I feel we can let that happen. Not servicing a request after
we have started system suspend doesn't look that odd..

Sysfs infrastructure is still preserved and so all that information would still
be available.

Do you see anything extra that might stop working?

>>> 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.

A unrelated question here. Why are we offlining CPUs after suspending all the
devices? Because the problem Nishanth mentioned was that he required few
devices, i2c, to be available when CPUs are getting down. And there might be
similar requirements at other places too. Was there any specific bottleneck due
to which it is implemented this way?

> 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.

I understand your point here. But this is what I feel:

- I don't have any special affection for using PM notifiers :) .. Its just that
I need some way for cpufreq core to know that Suspend has started. Maybe after
freezing of tasks and before removal of devices.

- I thought of adding something like a suspend-prepare for syscore_ops (You are
owner of all these frameworks and so our life is easy as we can discuss stuff
with you directly :)).. But then thought maybe we can use PM notifiers.. But it
looks that we better do that now ?

- I have concerns with Tianyu's patch as policies should be better taken care of
in cpufreq core instead of passing them over to governors. And with the
alternative solution I had, code is getting more and more dirty. And so I
thought of doing something else.

- Not all platforms have problem with changing frequency during suspend/resume
and so we may not require disabling of governors for all of them. Probably can
add another field based on which we may/may-not disable governors from PM or
syscore notifiers.

--
viresh

  reply	other threads:[~2013-11-17  8:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 10:12 [PATCH] cpufreq: suspend/resume governors with PM notifiers 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
2013-11-17  8:22           ` viresh kumar [this message]
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=52887CB7.4000108@linaro.org \
    --to=viresh.kumar@linaro.org \
    --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=rjw@rjwysocki.net \
    --cc=sebastian.capella@linaro.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tianyu.lan@intel.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;
as well as URLs for NNTP newsgroup(s).