From: <benh@kernel.crashing.org>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "Alan Cox" <alan@redhat.com>, "Pavel Machek" <pavel@ucw.cz>,
"Linus Torvalds" <torvalds@transmeta.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: swsusp: don't eat ide disks
Date: Sun, 3 Nov 2002 17:24:22 +0100 [thread overview]
Message-ID: <20021103162422.27845@smtp.wanadoo.fr> (raw)
In-Reply-To: <1036340733.29642.41.camel@irongate.swansea.linux.org.uk>
>That requires code in every driver. Duplicated, hard to write, likely to
>be racey code. Thats bad.
>
>The bigger picture really should be
>
>ACPI etc "I want to suspend to disk"
>
>PM layer
> Suspend the non I/O tasks (btw reminds me - eh tasks and
> all workqueues may be I/O tasks at times)
> Complete all the block I/O queues
> Throw out the pages we can evict
> Write suspend image
>
> Jump to PM layer "power off" logic
>
>If you do it that way up then no drivers need to be hacked about.
Hrm... thanks to the miracle of having a BIOS that will deal
with the grunt work of actually shutting down the chipsets,
resuming them, etc...
This is definitely not the case on pmac and embedded. Or did I
miss something to your explanation ?
I really don't like the above as it basically bypasse the
bus ordering, which is the only sane way I see to deal with
dependencies when the drivers are actually shutting down HW
While suspend to disk may justify suspention of all non IO
tasks etc..., when doing suspend to RAM, I get very good
results (and very fast suspend/resume cycles) by letting
just about everything run and relying on implicitly beeing
suspended as a result of relying on a service/driver that
has blocked it's queue.
But doing that properly definitely involve a precise process
to be followed by driver (though most drivers can actually
implement only a simplify version of it) so that we don't
fall in a case where a driver trying to allocate memory (to
save state for example) ends up blocking for ever because
it's hung waiting for a page to be swapped out on a device
that is already asleep.
We have debated this a lot with Patrick, Greg, Pavel, ...
and at the "improvised" PM BOF during OLS, and I really
think we should do it what I think is "the right way",
even if it seems slightly more complicated driver-side.
I'm pretty sure it's not actually _that_ complicated, and
in most case, the actual functionality can be provided by
helper routines in each functional subsystem, the important
point beeing that those have to be called by the driver at
appropriate moment so that ordering stays correct.
Also, I don't like, from the design point of view, the notion
of suspending tasks to "hope" no new IO requests will get
triggered. That involve specific coloring of various kernel
threads, and can be nasty if for any reason we end up having
IOs triggered asynchronously by non-tasks (though I'm not
sure that is possible in linux today).
Also, what about a driver that, for it's own suspend operation
needs to actually trigger an IO ? The disk is a typical case
where we want to send a STANDBY command (though the queue ?
synchronously ? after waiting for the initial queue emptyness ?).
I'd add to that the problem isn't specific to BIO queues. It's
the same problem we have to deal with URB lists, 1394 request
queues, etc... as we don't have a unified model for IO queues
(and that's good that way imho).
Anyway, all this is talk, I've started playing with moving
my pmac stuff to the new model, and I intend to actually
make things work the way I want at first as a proof of concept.
Then, I volunteer writing a HOWTO explaining clearly what a
driver should do for proper PM, and I'm pretty sure that won't
be that nasty and race prone as you are afraid of ;)
Ben.
next prev parent reply other threads:[~2002-11-03 16:18 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 18:47 swsusp: don't eat ide disks Pavel Machek
2002-11-02 19:39 ` Linus Torvalds
2002-11-02 20:06 ` Alan Cox
2002-11-02 20:25 ` Pavel Machek
2002-11-02 22:04 ` Alan Cox
2002-11-03 20:11 ` Pavel Machek
2002-11-04 1:04 ` Rik van Riel
2002-11-06 12:34 ` Pavel Machek
2002-11-03 14:57 ` benh
2002-11-03 16:25 ` Alan Cox
2002-11-03 16:24 ` benh [this message]
2002-11-03 16:36 ` Alan Cox
2002-11-04 7:47 ` benh
2002-11-03 20:12 ` Pavel Machek
2002-11-03 21:33 ` Alan Cox
2002-11-03 22:09 ` Pavel Machek
2002-11-03 22:41 ` Alan Cox
2002-11-03 22:27 ` Pavel Machek
2002-11-03 23:56 ` Alan Cox
2002-11-04 8:16 ` benh
2002-11-04 13:33 ` Alan Cox
2002-11-03 22:48 ` Linus Torvalds
2002-11-03 22:53 ` Linus Torvalds
2002-11-04 8:08 ` benh
2002-11-04 14:59 ` Linus Torvalds
2002-11-04 15:27 ` Benjamin Herrenschmidt
2002-11-04 9:44 ` Jens Axboe
2002-11-04 13:37 ` Alan Cox
2002-11-03 22:56 ` Pavel Machek
2002-11-03 23:38 ` Linus Torvalds
2002-11-06 13:57 ` Pavel Machek
2002-11-04 7:57 ` benh
2002-11-04 9:39 ` Jens Axboe
2002-11-04 9:50 ` Jens Axboe
2002-11-07 13:06 ` David Woodhouse
2002-11-07 16:15 ` Pavel Machek
2002-11-07 16:18 ` David Woodhouse
2002-11-07 20:52 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2002-11-07 18:26 Grover, Andrew
2002-11-07 22:25 ` David Woodhouse
2002-11-08 11:09 ` Benjamin Herrenschmidt
2002-11-10 11:54 ` Pavel Machek
2002-11-11 6:38 ` David Woodhouse
2002-11-12 17:41 ` Pavel Machek
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=20021103162422.27845@smtp.wanadoo.fr \
--to=benh@kernel.crashing.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=torvalds@transmeta.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