public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	suleiman@google.com, briannorris@google.com,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH v7 0/1] PM: sleep: Expose last succeeded resumed timestamp in sysfs
Date: Wed, 10 Jan 2024 00:04:47 +0900	[thread overview]
Message-ID: <20240110000447.73e6d3e5ad6e75d63ca1bd4b@kernel.org> (raw)
In-Reply-To: <170359668692.1864392.6909734045167510522.stgit@mhiramat.roam.corp.google.com>

Hi Rafael,

Could you review this new version?

Thank you,

On Tue, 26 Dec 2023 22:18:07 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> Hi,
> 
> Here is the 7th version of the patch to expose last succeeded resumed
> timestamp in sysfs as /sys/power/suspend_stats/last_success_resume_time.
> The previous version is here.
> 
> https://lore.kernel.org/all/170245316678.651355.6640896026073025688.stgit@mhiramat.roam.corp.google.com/
> 
> This version fixes code comments, sysfs description and patch
> description.
> 
> On some system like the ChromeOS, the system suspend and resume are
> controlled by a power management process. The user-space tasks will be
> noticed the suspend and the resume signal from it.
> To improve the suspend/resume performance and/or to find regressions,
> we would like to know how long the resume processes are taken in kernel
> and in user-space.
> 
> This patch introduces a last succeeded resumed timestamp (just before
> thawing processes) on sysfs which allows us to find when the kernel
> resume process successfully done in MONOTONIC clock. Thus user processes
> can measure the elapsed time taken by its resume process at any point
> in time.
> 
> This will help us to detect abnormal value (longer time) process in
> the resuming and quickly decide the root cause is in the kernel or
> user-space. The kernel side we can use many tools (e.g. printk or
> ftrace) but for user-space we need to define the starting point of
> the resuming process. Actually, the kernel side needs to use local
> clock because the clock subsystem is also suspended. But in that
> case, user space can not use that timestamp because the local clock
> is not exposed.
> 
> So this will be used something like
> 
> where_the_user_space_resume_finish() {
> 	clock_gettime(CLOCK_MONOTONIC, &etime_ts);
> 	fileread("/sys/.../last_success_resume_time", stime);
> 	convert_timespec(stime, &stime_ts);
> 	user_resume_time = timespec_delta(&etime_ts, &stime_ts);
> 	...
> }
> 
> Thank you,
> 
> ---
> 
> Masami Hiramatsu (1):
>       PM: sleep: Expose last succeeded resumed timestamp in sysfs
> 
> 
>  Documentation/ABI/testing/sysfs-power |   11 +++++++++++
>  include/linux/suspend.h               |    2 ++
>  kernel/power/main.c                   |   15 +++++++++++++++
>  kernel/power/suspend.c                |    9 +++++++++
>  4 files changed, 37 insertions(+)
> 
> --
> Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      parent reply	other threads:[~2024-01-09 15:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 13:18 [PATCH v7 0/1] PM: sleep: Expose last succeeded resumed timestamp in sysfs Masami Hiramatsu (Google)
2023-12-26 13:18 ` [PATCH v7] " Masami Hiramatsu (Google)
2024-01-17  0:07   ` Masami Hiramatsu
2024-01-19 21:07     ` Rafael J. Wysocki
2024-01-23  2:08       ` Brian Norris
2024-01-25  0:43         ` Masami Hiramatsu
2024-01-25 20:19           ` Rafael J. Wysocki
2024-01-30 14:51             ` Masami Hiramatsu
2024-01-09 15:04 ` Masami Hiramatsu [this message]

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=20240110000447.73e6d3e5ad6e75d63ca1bd4b@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=briannorris@google.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=suleiman@google.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