From: Nigel Cunningham <ncunningham@crca.org.au>
To: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>,
pm list <linux-pm@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
TuxOnIce-devel <tuxonice-devel@tuxonice.net>
Subject: Re: [SUSPECTED SPAM] Re: [linux-pm] Proposal for a new algorithm for reading & writing a hibernation image.
Date: Sat, 05 Jun 2010 13:17:41 +1000 [thread overview]
Message-ID: <4C09C1D5.2030603@crca.org.au> (raw)
In-Reply-To: <1275700569.18384.12.camel@maxim-laptop>
Hi.
On 05/06/10 11:16, Maxim Levitsky wrote:
>
>> If the memory it writes to isn't protected, there'll be no recursive
>> page fault and no problem, right? I'm imagining this page fault handler
>> will only set a flag to record that the page needs to be atomically
>> copied, copy the original contents to a page previously prepared for the
>> purpose, remove the write protection for the page and allow the write to
>> continue. That should be okay, right?
> I think so, although I have no experience yet to comment on such things.
> Despite that I think you might run out of 'page previously prepared for
> the purpose'
> However you can adopt a retrial process, like you do today in tuxonce.
> Just abort suspend, and do it again.
Yeah. I'm expecting that it will be reasonably predictable - at least
ballpark. I guess there's only one way to find out...
>>> Of course the sucky part will be how to edit the page tables.
>>> You might need to write your own code to do so to be sure.
>>> And this has to be arch specific.
>>
>> Yeah. I wondered whether the code that's already used for creating page
>> tables for the atomic restore could be reused, at least in part.
> This is very dangerous.
> The code might work now, and tomorrow somebody will add a code that does
> memory writes.
> The point is that you must be sure that there are no recursive faults,
> or somehow deal with them (this is probably too dangerous to even think
> of)
That shouldn't be too hard - after all, we're going to know what memory
we're using to record the info. As long as we don't do anything silly
like protecting our own data, we should be right.
>>> Since userspace is frozen, you can be sure that faults can only be
>>> caused by access to WO memory or kernel bugs.
>>
>> Userspace helpers or uswsusp shouldn't be forgotten.
> This is especially bad. because a fault in userspace will mean swapping.
> You won't get away with custom page fault for this.
> You could assure before suspend that all relevant userspace is not
> swapped, or forget about userspace, because its minor thing compared to
> speed increases of full memory write.
Mmm, but existing userspace helpers for TuxOnIce are carefully designed
so everything is in memory before we start work, and so that nothing is
done which will compromise the integrity of the image. I assume the same
applies to uswsusp. I'm more concerned just to make sure that we don't
forget to modify the page tables for these userspace processes (at least
the TuxOnIce ones) so that any modifications to kernel memory made while
in their process context are also caught.
Regards,
Nigel
next prev parent reply other threads:[~2010-06-05 3:17 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-03 14:50 [SUSPECTED SPAM] Re: [linux-pm] Proposal for a new algorithm for reading & writing a hibernation image Pavel Machek
2010-06-04 23:39 ` Maxim Levitsky
2010-06-04 23:58 ` Nigel Cunningham
2010-06-05 0:36 ` Maxim Levitsky
2010-06-05 0:45 ` Maxim Levitsky
2010-06-05 3:37 ` Nigel Cunningham
2010-06-05 0:47 ` Nigel Cunningham
2010-06-05 1:16 ` Maxim Levitsky
2010-06-05 3:17 ` Nigel Cunningham [this message]
2010-06-05 0:05 ` Nigel Cunningham
2010-06-05 12:59 ` [TuxOnIce-devel] " Theodore Tso
2010-06-05 23:01 ` Nigel Cunningham
2010-06-05 0:20 ` [linux-pm] [SUSPECTED SPAM] " Nigel Cunningham
2010-06-05 18:45 ` Rafael J. Wysocki
2010-06-05 19:10 ` Maxim Levitsky
2010-06-05 19:21 ` Rafael J. Wysocki
2010-06-05 22:54 ` Nigel Cunningham
2010-06-05 23:20 ` Rafael J. Wysocki
2010-06-06 7:01 ` Nigel Cunningham
2010-06-06 14:06 ` Rafael J. Wysocki
2010-06-07 5:23 ` Nigel Cunningham
2010-06-07 8:40 ` Rafael J. Wysocki
2010-06-06 0:40 ` Maxim Levitsky
2010-06-06 13:57 ` Rafael J. Wysocki
2010-06-06 15:54 ` Maxim Levitsky
2010-06-06 19:04 ` Rafael J. Wysocki
2010-06-06 19:51 ` Maxim Levitsky
2010-06-06 21:55 ` Pedro Ribeiro
2010-06-07 8:41 ` Rafael J. Wysocki
2010-06-07 5:31 ` Nigel Cunningham
2010-06-07 8:49 ` Rafael J. Wysocki
2010-06-08 2:07 ` Nigel Cunningham
2010-06-08 9:01 ` Rafael J. Wysocki
2010-06-07 13:07 ` [TuxOnIce-devel] " Martin Steigerwald
2010-06-07 21:28 ` Rafael J. Wysocki
2010-06-07 21:31 ` Nigel Cunningham
2010-06-07 5:28 ` Nigel Cunningham
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=4C09C1D5.2030603@crca.org.au \
--to=ncunningham@crca.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=maximlevitsky@gmail.com \
--cc=pavel@ucw.cz \
--cc=tuxonice-devel@tuxonice.net \
/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