From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: Sven van Ashbrook <svenva@chromium.org>
Cc: Rafael J Wysocki <rafael@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
S-k Shyam-sundar <Shyam-sundar.S-k@amd.com>,
rrangel@chromium.org, platform-driver-x86@vger.kernel.org,
Rajat Jain <rajatja@google.com>,
David E Box <david.e.box@intel.com>,
Hans de Goede <hdegoede@redhat.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [RFC 1/3] PM: Add a sysfs file to represent whether hardware reached the deepest state
Date: Tue, 1 Nov 2022 14:58:41 -0500 [thread overview]
Message-ID: <23c353e0-078f-91e4-26fe-bf552319eaad@amd.com> (raw)
In-Reply-To: <CAM7w-FXAGki+k9aP0wV1Qs8dKqpPXgY9ZJR_a83ETrUF6ZRZOw@mail.gmail.com>
On 11/1/2022 12:37, Sven van Ashbrook wrote:
> On Mon, Oct 31, 2022 at 4:43 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>>
>> +void pm_set_hw_deepest_state(u64 duration)
>> +{
>> + suspend_stats.last_hw_deepest_state = duration;
>
> I'm wondering if we could add a userspace notification here. Then
> userspace wouldn't have to synchronize with the suspend/resume state
> of the system when reading this entry.
>
> What about sysfs_notify() ? Or via udev?
The question I would have is what kobj would you notify? power_kobj?
Lots of other things write to suspend stats, but nothing else sends
notifications. So why is this one going to be special?
To me I don't think it's much different for userspace to "always" read
the file after resume vs wait for the notification and then read it.
To make userspace flexible to multiple kernel versions it seems to me
that userspace could check if that file exists before suspend and if it
does then check the value after suspend.
>
>> +}
>> +EXPORT_SYMBOL_GPL(pm_set_hw_deepest_state);
next prev parent reply other threads:[~2022-11-01 19:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 20:43 [RFC 0/3] Introduce infrastructure to report time in deepest state Mario Limonciello
2022-10-31 20:43 ` [RFC 1/3] PM: Add a sysfs file to represent whether hardware reached the " Mario Limonciello
2022-11-01 17:37 ` Sven van Ashbrook
2022-11-01 19:58 ` Limonciello, Mario [this message]
2022-11-08 20:27 ` David E. Box
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=23c353e0-078f-91e4-26fe-bf552319eaad@amd.com \
--to=mario.limonciello@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=david.e.box@intel.com \
--cc=hdegoede@redhat.com \
--cc=irenic.rajneesh@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rajatja@google.com \
--cc=rrangel@chromium.org \
--cc=svenva@chromium.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