Re: Async suspend-resume patch w/ completions (was: Re: Async suspend-resume patch w/ rwsems)

Rafael J. Wysocki
2009-12-14T22:11:05Z

On Monday 14 December 2009, Linus Torvalds wrote:
>
> On Sat, 12 Dec 2009, Rafael J. Wysocki wrote:
> >
> > One solution that we have discussed on linux-pm is to start a bunch of async
> > threads searching for async devices that can be suspended and suspending
> > them (assuming suspend is considered) out of order with respect to dpm_list.
>
> Ok, guys, stop the crazy.
>
> That's another of those "ok, that's just ttoally stupid and clearly too
> complex" ideas that I would never pull.
>
> I should seriously suggest that people just stop discussing architectural
> details on the pm list if they all end up being this level of crazy.
>
> The sane thing to do is to just totally ignore the async layer on PCI
> bridges and other things that only have a late-suspend/early-resume thing.
> No need for the above kind of obviously idiotic crap.
>
> However, my point was really that we wouldn't even have _needed_ that kind
> of special case if we had just decided to let the subsystems do it. But
> whatever. At worst, the PCI layer can even just mark such devices with
> just late/early suspend/resume as being asynchronous, even though that
> ends up resulting in some totally pointless async work that doesn't do
> anything.
>
> But please guys - reign in the crazy ideas on the pm list. It's not like
> our suspend/resume has gotten so stable as to be boring, and we want it to
> become unreliable again.

Indeed.

OK, what about a two-pass approach in which the first pass only inits the
completions and starts async threads for leaf "async" devices? I think leaf
devices are most likely to take much time to suspend, so this will give us
a chance to save quite some time.

A more aggressive version of this might start the async threads for all async
devices in the first pass and then only handle the sychronous ones in the
second pass - as long as there are only a few async devices that should be
quite efficient.

Rafael