From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
Matthew Garrett <mjg59@srcf.ucam.org>,
David Chinner <dgc@sgi.com>,
xfs-masters@oss.sgi.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Len Brown <lenb@kernel.org>
Subject: Re: freeze vs freezer
Date: Tue, 27 Nov 2007 15:32:02 -0800 [thread overview]
Message-ID: <474CA8F2.2030809@goop.org> (raw)
In-Reply-To: <DA9C1E3E-E7BD-4AC3-AD44-416FBD3871AF@mac.com>
Kyle Moffett wrote:
> On Nov 27, 2007, at 17:49:18, Jeremy Fitzhardinge wrote:
>> Rafael J. Wysocki wrote:
>>> Well, this is more-or-less how we all imagine that should be done
>>> eventually.
>>>
>>> The main problem is how to implement it without causing too much
>>> breakage. Also, there are some dirty details that need to be taken
>>> into consideration.
>>
>> For Xen suspend/resume, I'd like to use the freezer to get all
>> threads into a known consistent state (where, specifically, they
>> don't have any outstanding pagetable updates pending). In other
>> words, the freezer as it currently stands is what I want, modulo some
>> of these issues where it gets caught up unexpectedly. If threads end
>> up getting frozen anywhere preempt isn't explicitly disabled, it
>> wouldn't work for me.
>
> The problem with "one freezer" is that "known consistent state" means
> something completely different to every single driver and subsystem.
Not really. The freezer puts tasks into a particular well-understood
state: they're either in usermode, or in the kernel in the
refrigerator. And since the places which call into the refrigerator are
explicit in the source, and not terribly numerous, its easy to audit
exactly what the state is at each call.
> Xen wants it to mean "No pending page table updates and no more
> updates from this point forward". A network driver wants it to mean
> "All pending network packets DMAed out or in and the device shut down
> with all remaining packets queued. A SATA controller wants it to mean
> "All DMA quiesced and no more commands", etc.
Well, those are somewhat different. The existing suspend/resume driver
callbacks are sufficient for a device to be in that state. What I want
for Xen is more global: I just want to make sure tasks are not preempted
in the middle of a state which can't be suspended. The specific details
of the state I want are moderately complex, but short lived. The
problem with other mechanisms - like stop_machine - is that they can
leave threads preempted in one of the states I can't handle, whereas the
the freezer is more deterministic.
> The only way to have that work is to put minimal definitions of what
> state you care about in the drivers themselves. For Xen this means
> that you need to have an appropriately-timed suspend handler which
> hooks into Xen code very precisely to create and preserve the "No
> pending page table updates" state that you care about. It will be
> more work in the short term but it's the only maintainable solution in
> the long term IMO.
No, that doesn't really work. Aside from scattering hooks everywhere
there's pagetable updates, there's no real existing place to hook into.
While I could put those hooks in, they would amount to changing the
kernel-internal pagetable update interface for everyone to deal with a
corner case of a fairly obscure user - I don't think its a good tradeoff.
The freezer is nice because the state it puts each task into is
well-defined, and is well-suited for Xen's use. In fact, I would agree
with you that the use I want to put the freezer to better suits it than
its current use in suspend/resume.
J
next prev parent reply other threads:[~2007-11-27 23:32 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-22 3:54 freeze vs freezer Jeremy Fitzhardinge
2007-11-23 23:47 ` Rafael J. Wysocki
2007-11-26 18:44 ` Jeremy Fitzhardinge
2007-11-26 21:20 ` Rafael J. Wysocki
2007-11-26 21:17 ` David Chinner
2007-11-26 21:53 ` Rafael J. Wysocki
2007-11-27 5:38 ` Matthew Garrett
2007-11-27 17:40 ` Rafael J. Wysocki
2007-11-27 20:33 ` Kyle Moffett
2007-11-27 23:01 ` Rafael J. Wysocki
2007-11-27 22:49 ` Jeremy Fitzhardinge
2007-11-27 23:14 ` Kyle Moffett
2007-11-27 23:32 ` Jeremy Fitzhardinge [this message]
2008-01-02 16:02 ` Pavel Machek
2008-01-02 21:30 ` Nigel Cunningham
2008-01-02 22:04 ` Rafael J. Wysocki
2008-01-03 9:19 ` Nigel Cunningham
2008-01-03 9:47 ` Oliver Neukum
2008-01-03 9:52 ` Nigel Cunningham
2008-01-03 11:15 ` Oliver Neukum
2008-01-03 22:06 ` Nigel Cunningham
2008-01-04 20:54 ` Oliver Neukum
2008-01-05 1:38 ` Kyle Moffett
2008-01-05 21:18 ` Pavel Machek
2008-01-05 23:01 ` Nigel Cunningham
2008-01-03 22:31 ` Rafael J. Wysocki
2008-06-23 7:16 ` Pavel Machek
2008-06-23 14:00 ` Henrique de Moraes Holschuh
2008-06-24 8:08 ` Elias Oltmanns
2008-06-26 15:09 ` Pavel Machek
2008-06-29 22:12 ` [xfs-masters] " Dave Chinner
2008-06-29 23:22 ` Rafael J. Wysocki
2008-06-30 6:11 ` Christoph Hellwig
2008-06-30 20:34 ` Rafael J. Wysocki
2008-07-03 19:43 ` Eric Sandeen
2008-06-30 6:29 ` Dave Chinner
2008-06-30 6:37 ` Jeremy Fitzhardinge
2008-06-30 12:33 ` Dave Chinner
2008-06-30 21:00 ` Rafael J. Wysocki
2008-06-30 22:21 ` Dave Chinner
2008-06-30 22:38 ` Rafael J. Wysocki
2008-07-01 6:38 ` Dave Chinner
2008-07-01 14:35 ` Rafael J. Wysocki
2008-07-01 15:05 ` Elias Oltmanns
2008-07-01 15:17 ` Christoph Hellwig
2008-07-01 21:15 ` Dave Chinner
2008-07-01 21:46 ` Elias Oltmanns
2008-07-01 21:12 ` Dave Chinner
2008-07-01 21:21 ` Rafael J. Wysocki
2008-07-01 8:59 ` 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=474CA8F2.2030809@goop.org \
--to=jeremy@goop.org \
--cc=dgc@sgi.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=mrmacman_g4@mac.com \
--cc=rjw@sisk.pl \
--cc=xfs-masters@oss.sgi.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