All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Johan Hovold <johan@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Jon Hunter <jonathanh@nvidia.com>,
	Saravana Kannan <saravanak@google.com>
Subject: [PATCH v3 0/5] PM: sleep: Improvements of async suspend and resume of devices
Date: Fri, 14 Mar 2025 13:46:59 +0100	[thread overview]
Message-ID: <10629535.nUPlyArG6x@rjwysocki.net> (raw)

Hi Everyone,

This is a new iteration of the async suspend/resume improvements work:

https://lore.kernel.org/linux-pm/1915694.tdWV9SEqCh@rjwysocki.net/

which includes some rework and fixes of the patches in the series linked
above.  The most significant differences are splitting the second patch
into two patches and adding a change to treat consumers like children
during resume.

This new iteration is based on linux-pm.git/linux-next and on the recent
fix related to direct-complete:

https://lore.kernel.org/linux-pm/12627587.O9o76ZdvQC@rjwysocki.net/

The overall idea is still to start async processing for devices that have
at least some dependencies met, but not necessarily all of them, to avoid
overhead related to queuing too many async work items that will have to
wait for the processing of other devices before they can make progress.

Patch [1/5] does this in all resume phases, but it just takes children
into account (that is, async processing is started upfront for devices
without parents and then, after resuming each device, it is started for
the device's children).

Patches [2/5] does this in the suspend phase of system suspend and only
takes parents into account (that is, async processing is started upfront
for devices without any children and then, after suspending each device,
it is started for the device's parent).

Patch [3/5] extends it to the "late" and "noirq" suspend phases.

Patch [4/5] adds changes to treat suppliers like parents during suspend.
That is, async processing is started upfront for devices without any
children or consumers and then, after suspending each device, it is
started for the device's parent and suppliers.

Patch [5/5] adds changes to treat consumers like children during resume.
That is, async processing is started upfront for devices without a parent
or any suppliers and then, after resuming each device, it is started for
the device's children and consumers.

Preliminary test results from one sample system are below.

"Baseline" is the linux-pm.git/testing branch, "Parent/child"
is that branch with patches [1-3/5] applied and "Device links"
is that branch with patches [1-5/5] applied.

"s/r" means "regular" suspend/resume, noRPM is "late" suspend
and "early" resume, and noIRQ means the "noirq" phases of
suspend and resume, respectively.  The numbers are suspend
and resume times for each phase, in milliseconds.

         Baseline       Parent/child    Device links

       Suspend Resume  Suspend Resume  Suspend Resume

s/r    427     449     298     450     294     442
noRPM  13      1       13      1       13      1
noIRQ  31      25      28      24      28      26

s/r    408     442     298     443     301     447
noRPM  13      1       13      1       13      1
noIRQ  32      25      30      25      28      25

s/r    408     444     310     450     298     439
noRPM  13      1       13      1       13      1
noIRQ  31      24      31      26      31      24

It clearly shows an improvement in the suspend path after
applying patches [1-3/5], easily attributable to patch [2/5],
and clear difference after updating the async processing of
suppliers and consumers.

Note that there are systems where resume times are shorter after
patches [1-3/5] too, but more testing is necessary.

I do realize that this code can be optimized further, but it is not
particularly clear to me that any further optimizations would make
a significant difference and the changes in this series are deep
enough to do in one go.

Thanks!




             reply	other threads:[~2025-03-14 13:24 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 12:46 Rafael J. Wysocki [this message]
2025-03-14 12:50 ` [PATCH v3 1/5] PM: sleep: Resume children after resuming the parent Rafael J. Wysocki
2025-05-01  9:51   ` Jon Hunter
2025-05-02 20:33     ` Rafael J. Wysocki
2025-05-07 13:21       ` Jon Hunter
2025-05-07 13:39         ` Rafael J. Wysocki
2025-05-07 14:25           ` Rafael J. Wysocki
2025-05-07 14:39             ` Jon Hunter
2025-05-07 14:56               ` Rafael J. Wysocki
2025-05-07 15:39                 ` Jon Hunter
2025-05-07 16:43                   ` Rafael J. Wysocki
2025-05-08 13:38                     ` Jon Hunter
2025-05-08 18:06                       ` Rafael J. Wysocki
2025-05-10 11:39                   ` Rafael J. Wysocki
2025-05-10 11:50                     ` Jon Hunter
2025-07-11 13:08   ` Tudor Ambarus
2025-07-11 13:38     ` Rafael J. Wysocki
2025-07-11 13:54       ` Rafael J. Wysocki
2025-07-11 18:30         ` Saravana Kannan
2025-07-12  7:57           ` Rafael J. Wysocki
2025-07-12  7:54         ` Rafael J. Wysocki
2025-07-14  7:09           ` Tudor Ambarus
2025-07-14  7:29             ` Rafael J. Wysocki
2025-07-14 10:35               ` Tudor Ambarus
2025-07-14 12:14                 ` Tudor Ambarus
2025-03-14 13:13 ` [PATCH v3 2/5] PM: sleep: Suspend async parents after suspending children Rafael J. Wysocki
2025-06-02 12:11   ` Chris Bainbridge
2025-06-02 14:29     ` Rafael J. Wysocki
2025-06-02 15:21       ` Mario Limonciello
2025-06-02 19:58         ` Rafael J. Wysocki
2025-06-03  9:38           ` Rafael J. Wysocki
2025-06-03 10:17             ` Chris Bainbridge
2025-06-03 10:29               ` Rafael J. Wysocki
2025-06-03 10:30                 ` Rafael J. Wysocki
2025-06-03 11:37                   ` Rafael J. Wysocki
2025-06-03 11:39                     ` Rafael J. Wysocki
2025-06-03 12:14                       ` Chris Bainbridge
2025-06-03 12:23                         ` Rafael J. Wysocki
2025-06-03 12:26                           ` Chris Bainbridge
2025-06-03 13:04                             ` Rafael J. Wysocki
2025-06-03 13:36                               ` Chris Bainbridge
2025-06-03 13:59                                 ` Rafael J. Wysocki
2025-03-14 13:14 ` [PATCH v3 3/5] PM: sleep: Make suspend of devices more asynchronous Rafael J. Wysocki
2025-03-14 13:16 ` [PATCH v3 4/5] PM: sleep: Make async suspend handle suppliers like parents Rafael J. Wysocki
2025-03-14 13:17 ` [PATCH v3 5/5] PM: sleep: Make async resume handle consumers like children Rafael J. Wysocki
2025-03-14 21:06 ` [PATCH v3 0/5] PM: sleep: Improvements of async suspend and resume of devices Saravana Kannan
2025-03-15 14:57   ` Rafael J. Wysocki
2025-04-08 13:39     ` 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=10629535.nUPlyArG6x@rjwysocki.net \
    --to=rjw@rjwysocki.net \
    --cc=johan@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=saravanak@google.com \
    --cc=stern@rowland.harvard.edu \
    --cc=ulf.hansson@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.