From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
linux-pm <linux-pm@lists.linux-foundation.org>,
linux-acpi <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Len Brown <lenb@kernel.org>,
Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [RFC][PATCH 0/3] PM: Asynchronous suspend and resume
Date: Fri, 14 Aug 2009 13:58:54 +0200 [thread overview]
Message-ID: <200908141358.54129.rjw@sisk.pl> (raw)
In-Reply-To: <1250220244.1804.9.camel@rzhang-dt>
On Friday 14 August 2009, Zhang Rui wrote:
> On Fri, 2009-08-14 at 02:08 +0800, Rafael J. Wysocki wrote:
> > On Thursday 13 August 2009, Zhang Rui wrote:
> > > On Thu, 2009-08-13 at 05:43 +0800, Rafael J. Wysocki wrote:
> > > > On Wednesday 12 August 2009, Alan Stern wrote:
> > > > > On Wed, 12 Aug 2009, Rafael J. Wysocki wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > The following patches introduce a mechanism allowing us to execute device
> > > > > > drivers' suspend and resume callbacks asynchronously during system sleep
> > > > > > transitions, such as suspend to RAM. The idea is explained in the [1/1] patch
> > > > > > message.
> > > > > >
> > > > > > Comments welcome.
> > > > >
> > > > > I get the idea. Not bad.
> > > >
> > > > Thanks!
> > > >
> > > > > Have you tried it in a serious way? For example, turning on the
> > > > > async_suspend flag for every device?
> > > >
> > > > No, I've only tested it with a few selected drivers. I'm going to try the
> > > > "async everyone" scenario, though.
> > > >
> > > > > In one way it isn't as efficient as it could be. You fire off a bunch
> > > > > of async threads and then make many of them wait for parent or child
> > > > > devices. They could be doing useful work instead.
> > > >
> > > are you talking about this scenario, or I find another problem of this
> > > approach:
> > > there is a part of dpm_list, dev1->dev_aaa->...->dev_bbb->dev2
> > >
> > > dev2 is dev1's first child.
> > > dev1 resume takes 1s
> > > dev_aaa~dev_bbb resume takes 0.1s.
> > >
> > > if we call device_enable_async_suspend(dev1, true) in order to resume
> > > device1 asynchronously, the real asynchronous resume only happens
> > > between dev1 and dev_aaa to dev_bbb because dev2 needs to wait until
> > > dev1 resume finished.
> >
> > Yes, that's how it works, but I would call it a limitation rather than a
> > problem. It partially stems from the fact that __async_schedule() executes
> > ptr() synchronously in some circumstances (e.g. async_enabled unset), so the
> > suspend and resume callbacks have to be scheduled in the same order, in which
> > they would have been called synchronously.
> >
> > > so kernel schedules dev1 resume in an async thread first, and then takes
> > > 0.1s to finish the dev_aaa to dev_bbb resume, and then sleep 0.9s
> > >
> > > > I kind of agree, but then the patches would be more complicated.
> > > >
> > > The problem is that we need to invoke device_resume for every device
> > > synchronously.
> >
> > Yes, we do.
> >
> > > I wonder if we can make the child devices inherit the
> > > parent's dev->power.async_suspend flag, so that devices that need to
> > > wait are resumed asynchronously, i.e. we never wait/sleep when parsing
> > > the dpm_list.
> > >
> > > this doesn't bring too much benefit in suspend case but it can speed up
> > > the resume process a lot.
> >
> > We can do that at the core level,
>
> I think you mean we can't do that at the core level.
That's correct, sorry for the mistake.
> > because there may be dependencies between
> > the children the core doesn't know about. Subsystems are free to set
> > async_suspend for the entire branches of device hierarchy if they are known
> > not to contain any off-tree dependencies, but the core has no information
> > about that.
> >
> hmm, but the current patch doesn't handle the off-tree dependencies
> neither.
> e.g.
> dev1, dev2, dev3
> dev2 depends on dev1, dev3 is dev1's first child,
> we only promise that dev1 has been resumed before resuming dev3 in the
> current proposal.
Sure, and that's why I said "if they are known not to contain any off-tree
dependencies". IOW, if a subsystem (e.g. platform) knows that none of its
devices have any off-tree dependencies, it can safely set async_suspend for
all of them.
> anyway, this is not a problem after the pm_connection stuff is
> implemented. :)
Well, that's going to take some time I guess.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
"linux-pm" <linux-pm@lists.linux-foundation.org>,
"linux-acpi" <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Len Brown <lenb@kernel.org>,
Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [RFC][PATCH 0/3] PM: Asynchronous suspend and resume
Date: Fri, 14 Aug 2009 13:58:54 +0200 [thread overview]
Message-ID: <200908141358.54129.rjw@sisk.pl> (raw)
In-Reply-To: <1250220244.1804.9.camel@rzhang-dt>
On Friday 14 August 2009, Zhang Rui wrote:
> On Fri, 2009-08-14 at 02:08 +0800, Rafael J. Wysocki wrote:
> > On Thursday 13 August 2009, Zhang Rui wrote:
> > > On Thu, 2009-08-13 at 05:43 +0800, Rafael J. Wysocki wrote:
> > > > On Wednesday 12 August 2009, Alan Stern wrote:
> > > > > On Wed, 12 Aug 2009, Rafael J. Wysocki wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > The following patches introduce a mechanism allowing us to execute device
> > > > > > drivers' suspend and resume callbacks asynchronously during system sleep
> > > > > > transitions, such as suspend to RAM. The idea is explained in the [1/1] patch
> > > > > > message.
> > > > > >
> > > > > > Comments welcome.
> > > > >
> > > > > I get the idea. Not bad.
> > > >
> > > > Thanks!
> > > >
> > > > > Have you tried it in a serious way? For example, turning on the
> > > > > async_suspend flag for every device?
> > > >
> > > > No, I've only tested it with a few selected drivers. I'm going to try the
> > > > "async everyone" scenario, though.
> > > >
> > > > > In one way it isn't as efficient as it could be. You fire off a bunch
> > > > > of async threads and then make many of them wait for parent or child
> > > > > devices. They could be doing useful work instead.
> > > >
> > > are you talking about this scenario, or I find another problem of this
> > > approach:
> > > there is a part of dpm_list, dev1->dev_aaa->...->dev_bbb->dev2
> > >
> > > dev2 is dev1's first child.
> > > dev1 resume takes 1s
> > > dev_aaa~dev_bbb resume takes 0.1s.
> > >
> > > if we call device_enable_async_suspend(dev1, true) in order to resume
> > > device1 asynchronously, the real asynchronous resume only happens
> > > between dev1 and dev_aaa to dev_bbb because dev2 needs to wait until
> > > dev1 resume finished.
> >
> > Yes, that's how it works, but I would call it a limitation rather than a
> > problem. It partially stems from the fact that __async_schedule() executes
> > ptr() synchronously in some circumstances (e.g. async_enabled unset), so the
> > suspend and resume callbacks have to be scheduled in the same order, in which
> > they would have been called synchronously.
> >
> > > so kernel schedules dev1 resume in an async thread first, and then takes
> > > 0.1s to finish the dev_aaa to dev_bbb resume, and then sleep 0.9s
> > >
> > > > I kind of agree, but then the patches would be more complicated.
> > > >
> > > The problem is that we need to invoke device_resume for every device
> > > synchronously.
> >
> > Yes, we do.
> >
> > > I wonder if we can make the child devices inherit the
> > > parent's dev->power.async_suspend flag, so that devices that need to
> > > wait are resumed asynchronously, i.e. we never wait/sleep when parsing
> > > the dpm_list.
> > >
> > > this doesn't bring too much benefit in suspend case but it can speed up
> > > the resume process a lot.
> >
> > We can do that at the core level,
>
> I think you mean we can't do that at the core level.
That's correct, sorry for the mistake.
> > because there may be dependencies between
> > the children the core doesn't know about. Subsystems are free to set
> > async_suspend for the entire branches of device hierarchy if they are known
> > not to contain any off-tree dependencies, but the core has no information
> > about that.
> >
> hmm, but the current patch doesn't handle the off-tree dependencies
> neither.
> e.g.
> dev1, dev2, dev3
> dev2 depends on dev1, dev3 is dev1's first child,
> we only promise that dev1 has been resumed before resuming dev3 in the
> current proposal.
Sure, and that's why I said "if they are known not to contain any off-tree
dependencies". IOW, if a subsystem (e.g. platform) knows that none of its
devices have any off-tree dependencies, it can safely set async_suspend for
all of them.
> anyway, this is not a problem after the pm_connection stuff is
> implemented. :)
Well, that's going to take some time I guess.
Thanks,
Rafael
next prev parent reply other threads:[~2009-08-14 11:58 UTC|newest]
Thread overview: 153+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 20:18 [RFC][PATCH 0/3] PM: Asynchronous suspend and resume Rafael J. Wysocki
2009-08-12 20:20 ` [RFC][PATCH 1/3] PM: Asynchronous resume of devices Rafael J. Wysocki
2009-08-12 20:20 ` Rafael J. Wysocki
2009-08-14 16:33 ` Pavel Machek
2009-08-15 20:59 ` Rafael J. Wysocki
2009-08-15 20:59 ` Rafael J. Wysocki
2009-08-22 9:24 ` Pavel Machek
2009-08-22 21:45 ` Rafael J. Wysocki
2009-08-22 21:45 ` Rafael J. Wysocki
2009-08-22 9:24 ` Pavel Machek
2009-08-14 16:33 ` Pavel Machek
2009-08-12 20:21 ` [RFC][PATCH 2/3] PM: Asynchronous suspend " Rafael J. Wysocki
2009-08-14 16:35 ` Pavel Machek
2009-08-15 21:04 ` Rafael J. Wysocki
2009-08-22 9:25 ` Pavel Machek
2009-08-22 21:46 ` Rafael J. Wysocki
2009-08-22 21:46 ` Rafael J. Wysocki
2009-08-22 9:25 ` Pavel Machek
2009-08-15 21:04 ` Rafael J. Wysocki
2009-08-14 16:35 ` Pavel Machek
2009-08-12 20:21 ` Rafael J. Wysocki
2009-08-12 20:22 ` [RFC][PATCH 3/3] PM: Asynchronous suspend and resume for ACPI battery Rafael J. Wysocki
2009-08-12 20:22 ` Rafael J. Wysocki
2009-08-12 21:12 ` [RFC][PATCH 0/3] PM: Asynchronous suspend and resume Alan Stern
2009-08-12 21:43 ` Rafael J. Wysocki
2009-08-12 21:43 ` Rafael J. Wysocki
2009-08-13 8:18 ` Zhang Rui
2009-08-13 8:18 ` Zhang Rui
2009-08-13 18:08 ` Rafael J. Wysocki
2009-08-13 18:08 ` Rafael J. Wysocki
2009-08-14 3:24 ` Zhang Rui
2009-08-14 3:24 ` Zhang Rui
2009-08-14 11:58 ` Rafael J. Wysocki [this message]
2009-08-14 11:58 ` Rafael J. Wysocki
2009-08-14 11:58 ` Rafael J. Wysocki
2009-08-13 18:08 ` Rafael J. Wysocki
2009-08-13 8:18 ` Zhang Rui
2009-08-13 14:45 ` Alan Stern
2009-08-13 14:45 ` Alan Stern
2009-08-13 18:28 ` Rafael J. Wysocki
2009-08-13 18:28 ` Rafael J. Wysocki
2009-08-13 18:39 ` Alan Stern
2009-08-13 21:10 ` Rafael J. Wysocki
2009-08-13 21:10 ` Rafael J. Wysocki
2009-08-13 18:39 ` Alan Stern
2009-08-13 21:53 ` Rafael J. Wysocki
2009-08-13 21:53 ` Rafael J. Wysocki
2009-08-14 14:45 ` Alan Stern
2009-08-14 14:45 ` Alan Stern
2009-08-14 19:12 ` Rafael J. Wysocki
2009-08-14 21:21 ` Alan Stern
2009-08-14 21:21 ` Alan Stern
2009-08-14 21:31 ` Rafael J. Wysocki
2009-08-14 21:37 ` Alan Stern
2009-08-14 21:37 ` Alan Stern
2009-08-16 10:29 ` Rafael J. Wysocki
2009-08-16 10:29 ` [linux-pm] " Rafael J. Wysocki
2009-08-16 10:29 ` Rafael J. Wysocki
2009-08-14 21:31 ` Rafael J. Wysocki
2009-08-14 19:12 ` Rafael J. Wysocki
2009-08-12 21:12 ` Alan Stern
2009-08-14 16:33 ` Pavel Machek
2009-08-15 21:00 ` Rafael J. Wysocki
2009-08-15 21:00 ` Rafael J. Wysocki
2009-08-14 16:33 ` Pavel Machek
2009-08-17 0:15 ` [RFC][PATCH 0/7] PM: Asynchronous suspend and resume (updated) Rafael J. Wysocki
2009-08-17 0:15 ` Rafael J. Wysocki
2009-08-17 0:16 ` [RFC][PATCH 1/7] PM: Update kerneldoc comments in drivers/base/power/main.c Rafael J. Wysocki
2009-08-19 21:57 ` Rafael J. Wysocki
2009-08-19 21:57 ` Rafael J. Wysocki
2009-08-19 22:00 ` Randy Dunlap
2009-08-19 22:00 ` Randy Dunlap
2009-08-19 22:06 ` Greg KH
2009-08-19 22:06 ` Greg KH
2009-08-19 22:28 ` Alan Stern
2009-08-19 23:14 ` Rafael J. Wysocki
2009-08-20 14:00 ` Alan Stern
2009-08-20 14:00 ` Alan Stern
2009-08-19 23:14 ` Rafael J. Wysocki
2009-08-19 22:28 ` Alan Stern
2009-08-26 15:44 ` Pavel Machek
2009-08-26 15:44 ` Pavel Machek
2009-08-17 0:16 ` Rafael J. Wysocki
2009-08-17 0:17 ` [RFC][PATCH 2/7] PM: Framework for representing PM links between devices Rafael J. Wysocki
2009-08-21 22:27 ` [RFC][PATCH 2/7 update] " Rafael J. Wysocki
2009-08-21 22:27 ` Rafael J. Wysocki
2009-08-17 0:17 ` [RFC][PATCH 2/7] " Rafael J. Wysocki
2009-08-17 0:18 ` [RFC][PATCH 3/7] PM: Asynchronous resume of I/O devices Rafael J. Wysocki
2009-08-23 22:09 ` [RFC][PATCH 3/7 updated] " Rafael J. Wysocki
2009-08-23 22:09 ` Rafael J. Wysocki
2009-08-17 0:18 ` [RFC][PATCH 3/7] " Rafael J. Wysocki
2009-08-17 0:19 ` [RFC][PATCH 4/7] PM: Asynchronous suspend " Rafael J. Wysocki
2009-08-17 0:19 ` Rafael J. Wysocki
2009-08-17 0:20 ` [RFC][PATCH 5/7] PM: Asynchronous suspend and resume of PCI devices Rafael J. Wysocki
2009-08-18 6:57 ` Zhang Rui
2009-08-18 6:57 ` Zhang Rui
2009-08-18 13:47 ` Alan Stern
2009-08-18 13:47 ` Alan Stern
2009-08-18 6:57 ` Zhang Rui
2009-08-17 0:20 ` Rafael J. Wysocki
2009-08-17 0:20 ` [RFC][PATCH 6/7] PM: Asynchronous suspend and resume of ACPI devices Rafael J. Wysocki
2009-08-17 0:20 ` Rafael J. Wysocki
2009-08-17 0:21 ` [RFC][PATCH 7/7] PM: Asynchronous suspend and resume of i8042 Rafael J. Wysocki
2009-08-18 7:03 ` Zhang Rui
2009-08-18 7:03 ` Zhang Rui
2009-08-18 7:03 ` Zhang Rui
2009-08-18 19:57 ` Rafael J. Wysocki
2009-08-18 23:40 ` Rafael J. Wysocki
2009-08-18 23:40 ` Rafael J. Wysocki
2009-08-18 23:40 ` Rafael J. Wysocki
2009-08-18 19:57 ` Rafael J. Wysocki
2009-08-26 15:43 ` Pavel Machek
2009-08-26 15:43 ` Pavel Machek
2009-08-17 0:21 ` Rafael J. Wysocki
2009-08-18 1:59 ` [RFC][PATCH 0/7] PM: Asynchronous suspend and resume (updated) Zhang Rui
2009-08-18 1:59 ` Zhang Rui
2009-08-18 7:16 ` Zhang Rui
2009-08-18 7:16 ` Zhang Rui
2009-08-18 20:01 ` Rafael J. Wysocki
2009-08-18 20:01 ` Rafael J. Wysocki
2009-08-18 20:01 ` Rafael J. Wysocki
2009-08-18 23:58 ` Rafael J. Wysocki
2009-08-18 23:58 ` Rafael J. Wysocki
2009-08-18 23:58 ` Rafael J. Wysocki
2009-08-19 1:05 ` Zhang Rui
2009-08-19 1:05 ` Zhang Rui
2009-08-19 1:05 ` Zhang Rui
2009-08-19 21:02 ` Rafael J. Wysocki
2009-08-21 7:40 ` Zhang Rui
2009-08-21 7:40 ` Zhang Rui
2009-08-19 21:02 ` Rafael J. Wysocki
2009-08-26 15:44 ` Pavel Machek
2009-08-26 15:44 ` Pavel Machek
2009-08-18 7:16 ` Zhang Rui
2009-08-18 14:04 ` Alan Stern
2009-08-18 14:04 ` Alan Stern
2009-08-18 19:56 ` Rafael J. Wysocki
2009-08-18 20:22 ` Alan Stern
2009-08-18 20:22 ` Alan Stern
2009-08-18 22:33 ` Rafael J. Wysocki
2009-08-18 22:33 ` Rafael J. Wysocki
2009-08-19 14:07 ` Alan Stern
2009-08-19 21:17 ` Rafael J. Wysocki
2009-08-19 22:34 ` Alan Stern
2009-08-19 22:34 ` Alan Stern
2009-08-20 15:56 ` Rafael J. Wysocki
2009-08-20 15:56 ` Rafael J. Wysocki
2009-08-19 21:17 ` Rafael J. Wysocki
2009-08-19 14:07 ` Alan Stern
2009-08-18 19:56 ` Rafael J. Wysocki
2009-08-26 13:20 ` Pavel Machek
2009-08-26 13:20 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2009-08-12 20:18 [RFC][PATCH 0/3] PM: Asynchronous suspend and resume 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=200908141358.54129.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=arjan@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rui.zhang@intel.com \
--cc=stern@rowland.harvard.edu \
/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.