All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: "Jarzmik, Robert" <robert.jarzmik@intel.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: S3, SMP non boot cpus and /sys/devices/system/cpu[1-9]/cpufreq/scaling_max_freq
Date: Tue, 14 May 2013 15:39:47 +0530	[thread overview]
Message-ID: <51920D6B.7030904@linux.vnet.ibm.com> (raw)
In-Reply-To: <65F5F98566038744B1B43C8FD3B7549F191199BC@IRSMSX104.ger.corp.intel.com>

On 05/14/2013 02:36 PM, Jarzmik, Robert wrote:
> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@sisk.pl] 
> Sent: Tuesday, May 14, 2013 1:33 AM
> To: Srivatsa S. Bhat; Jarzmik, Robert
> Cc: linux-pm@vger.kernel.org
> Subject: Re: S3, SMP non boot cpus and /sys/devices/system/cpu[1-9]/cpufreq/scaling_max_freq
> 
>>> So my question is : is it intended behavior that no udev offline/online event happens on S3 for non-boot CPUs, or is it something I should try to fix ?
>>
>> IMHO, using CPU hotplug (offline/online of CPUs) in the S3 path is 
>> supposed to be totally internal to the suspend/resume code.
>> It is not intended for userspace to know that we are internally 
>> offlining/onlining CPUs. So I'm not surprised that udev events are not 
>> triggered for hotplug in S3 path. And that's not a bug, if you ask me. 
>> (And yes, even code-wise, we use a slightly different path in the S3 
>> code, to initiate hotplug. That's why the uevents are by-passed.)
>>
>> The user initiated an S3 operation, not CPU hotplug. So there is no 
>> reason to surprise the user with unexpected events.
> Hi Srivatsa,
> 
> But the user actually *is* very surprised to have "lost" his
> permissions to write to scaling_max_freq.

And losing permissions isn't specific to suspend-to-ram right?
You said that yourself, that on regular cpu online/offline you lose
the changed permissions. So just write a resume hook to restore whatever
permissions you want after suspend-resume. See /usr/lib64/pm-utils/sleep.d
for some sample resume scripts.

> Or, told differently,
> if a userspace process handles this scaling_max_freq based on
> thermal values for example, a suspend/resume will impede his
> capacity to throttle the CPU, and the CPU will overheat.
> 
> A good example is an Android phone : imagine the thermal will not
> be able anymore to throttle the CPU, the phone will become hot
> and possibly burn the user (yeah, that's not very probable but
> still ...).
> 
> So you say "there is no reason to surprise the user with
> unexpected events", and I say "this is a bug that permissions of
> a /sys file change because a suspend/resume happened". Now if I'm
> right, what could be done to keep these permissions, other than
> adding a udev event ?
> 

The point I was trying to make is that expecting udev events for
CPU online/offline during S3 is wrong. Nobody is supposed to know that
we are offlining/onlining CPUs under-the-hood.
If you want to do something special on resume, use a resume script
that is automatically invoked for you upon system resume.

Regards,
Srivatsa S. Bhat


  reply	other threads:[~2013-05-14 10:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 13:01 S3, SMP non boot cpus and /sys/devices/system/cpu[1-9]/cpufreq/scaling_max_freq Jarzmik, Robert
2013-05-13 20:40 ` Srivatsa S. Bhat
2013-05-13 23:32   ` Rafael J. Wysocki
2013-05-14  9:06     ` Jarzmik, Robert
2013-05-14 10:09       ` Srivatsa S. Bhat [this message]
2013-05-14 10:22         ` Viresh Kumar
2013-05-14 10:27           ` Srivatsa S. Bhat
2013-05-14 11:22             ` Rafael J. Wysocki
2013-05-14 11:20               ` R, Durgadoss
2013-05-14 11:33                 ` Rafael J. Wysocki
2013-05-14 11:36                   ` R, Durgadoss
2013-05-14 11:54                     ` Jarzmik, Robert
2013-05-14 12:34                       ` Srivatsa S. Bhat
2013-05-14 13:00                         ` Rafael J. Wysocki
2013-05-14 13:54                           ` Srivatsa S. Bhat
2013-05-14 20:22                             ` Rafael J. Wysocki
2013-05-15  8:24                               ` Jarzmik, Robert
2013-05-15  8:37                               ` R, Durgadoss
2013-05-15  6:16                             ` Viresh Kumar
2013-05-15  6:30                               ` Srivatsa S. Bhat
2013-05-15  6:45                             ` Viresh Kumar
2013-05-15  7:33                               ` Srivatsa S. Bhat
2013-05-15  7:44                                 ` Viresh Kumar
2013-05-15  8:18                                   ` Srivatsa S. Bhat
2013-05-15 20:50                             ` Rafael J. Wysocki
2013-05-14 12:58                       ` Rafael J. Wysocki
2013-05-14 14:01                         ` Jarzmik, Robert
2013-05-14 14:16                           ` Srivatsa S. Bhat
2013-05-14 14:05                       ` Alan Stern
2013-05-15  9:20                         ` Jarzmik, Robert
2013-05-15 14:15                           ` Alan Stern

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=51920D6B.7030904@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=robert.jarzmik@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.