mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Sven van Ashbrook <svenva@chromium.org>,
	John Stultz <jstultz@google.com>, Len Brown <len.brown@intel.com>,
	Pavel Machek <pavel@ucw.cz>, Raul Rangel <rrangel@chromium.org>,
	David E Box <david.e.box@intel.com>,
	Rajat Jain <rajatja@google.com>,
	S-k Shyam-sundar <Shyam-sundar.S-k@amd.com>,
	Hans de Goede <hdegoede@redhat.com>,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v5 1/4] PM: Add a sysfs file to represent time spent in hardware sleep state
Date: Fri, 31 Mar 2023 13:13:43 -0500	[thread overview]
Message-ID: <8a04da89-1c98-8b29-bf96-1e8d0ed47e58@amd.com> (raw)
In-Reply-To: <CAJZ5v0iia9__-jWmawvsxninoTM5ZRtqhyUJme=noZMZJdUBrA@mail.gmail.com>

On 3/31/2023 13:07, Rafael J. Wysocki wrote:
> On Fri, Mar 31, 2023 at 8:05 PM Limonciello, Mario
> <mario.limonciello@amd.com> wrote:
>>
>> On 3/31/2023 13:01, Rafael J. Wysocki wrote:
>>> On Thu, Mar 30, 2023 at 9:45 PM Mario Limonciello
>>> <mario.limonciello@amd.com> wrote:
>>>>
>>>> Userspace can't easily discover how much of a sleep cycle was spent in a
>>>> hardware sleep state without using kernel tracing and vendor specific sysfs
>>>> or debugfs files.
>>>>
>>>> To make this information more discoverable, introduce a new sysfs file
>>>> to represent the time spent in a sleep state.
>>>
>>> This is only in the most recent suspend-resume cycle, isn't it?
>>
>> Yes; that's correct.
>>
>>>
>>> Wouldn't it be useful to have another attribute printing the
>>> accumulated total HW sleep time?
>>>
>>
>> I had considered this; but I didn't think it was actually very useful
>> because userspace will get control at the end of every cycle and can
>> accumulate those numbers if desirable.
> 
> Unless "user space" in question is actually a human, that is.

This is what I envisioned:

* In traditional Linux some software like systemd could capture this and 
log it.
It could subtract at the time the suspend started from the time it ended 
and use that to calculate a percentage of time in hardware sleep state 
and then put that percentage in the system journal.

* In ChromeOS something like powerd would be the only thing reading this 
number and it could be adding it up during dark resume until the system 
gets to a full resume.

* If a human is manually capturing these values they'll be most 
interested in whether an individual cycle reached hardware sleep.
If it didn't they'll want to look at debug data from that cycle.
The aggregate will be noise.

Do you think of another use case?

  reply	other threads:[~2023-03-31 18:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 19:44 [PATCH v5 0/4] Add vendor agnostic mechanism to report hardware sleep Mario Limonciello
2023-03-30 19:44 ` [PATCH v5 1/4] PM: Add a sysfs file to represent time spent in hardware sleep state Mario Limonciello
2023-03-31 18:01   ` Rafael J. Wysocki
2023-03-31 18:05     ` Limonciello, Mario
2023-03-31 18:07       ` Rafael J. Wysocki
2023-03-31 18:13         ` Limonciello, Mario [this message]
2023-03-31 18:25           ` Rafael J. Wysocki
2023-03-30 19:44 ` [PATCH v5 2/4] platform/x86/amd: pmc: Report duration of time in hw " Mario Limonciello
2023-03-30 19:44 ` [PATCH v5 3/4] platform/x86/intel/pmc: core: Always capture counters on suspend Mario Limonciello
2023-04-03 16:58   ` Box, David E
2023-03-30 19:44 ` [PATCH v5 4/4] platform/x86/intel/pmc: core: Report duration of time in HW sleep state Mario Limonciello
2023-03-31  3:02   ` kernel test robot
2023-03-31 18:05   ` Rafael J. Wysocki
2023-04-03 18:00     ` Box, David E
2023-04-03 18:07       ` Limonciello, Mario
2023-04-03 18:32         ` Rafael J. Wysocki

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=8a04da89-1c98-8b29-bf96-1e8d0ed47e58@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=jstultz@google.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

all inboxes | Powered by JetHome®