Skip to contentSkip to conversation

Patrick's Test9 suspend code.

DISCUSSION Shaheed 4 participants 8 messages Nov 20, 2003 – Nov 21, 2003

lore
Share & tools
lore

Shaheed

author
#0 lore raw
Quoted 3 lines

B) A heuristic that looks at the mounted block devices for things that smell like a resume partition would actually be more robust in that case.

How about a static signature followed by a timestamp? That way, maybe we could have a resume menu like this:

/dev/hda3 (kernel 2.7.88, suspended on 01-04-2004 20:00:00) /dev/hda4 (kernel 2.8.99, suspended on 31-05-2005 20:00:00) *** Resume in 5..4..3..2..1..

with a 5 second countdown before it chooses the most recent? Or in Pavel's examples:

Erk! Nowhere to resume from!

:-)

#1 lore raw
Quoted 10 lines · Shaheed
Quoted 2 lines

B) A heuristic that looks at the mounted block devices for things that smell like a resume partition would actually be more robust in that case.

How about a static signature followed by a timestamp? That way, maybe we could have a resume menu like this:

/dev/hda3 (kernel 2.7.88, suspended on 01-04-2004 20:00:00) /dev/hda4 (kernel 2.8.99, suspended on 31-05-2005 20:00:00) *** Resume in 5..4..3..2..1..

Quoted 6 lines

with a 5 second countdown before it chooses the most recent? Or in Pavel's examples:

Erk! Nowhere to resume from!

:-)

When resuming from a writeable filesystem, the filesystem has to match the contents of suspended memory. If you've TOUCHED the filesystem since suspending, the resume is going to shred it, cross-link the heck out of it, and generally be evil. (There are open filehandles saved in there, page table entries to maped stuff... Just don't go there.)

Rob

author
#2 lore raw
Quoted 5 lines · Rob Landley

When resuming from a writeable filesystem, the filesystem has to match the contents of suspended memory. If you've TOUCHED the filesystem since suspending, the resume is going to shred it, cross-link the heck out of it, and generally be evil. (There are open filehandles saved in there, page table entries to maped stuff... Just don't go there.)

Understood. But by definition, there must be at least one page of data on the filesystem whose location we know in order to do the resume. Why can't we simply use one extra page to store this data?

At least in my reading of suspend/main.c we create a directory of pages which itself is stored on disk. Since we do that, can't we simply use an extra page for this signature?

#3 lore raw

Hi.

Quoted 3 lines · Shaheed

Understood. But by definition, there must be at least one page of data on the filesystem whose location we know in order to do the resume. Why can't we simply use one extra page to store this data?

Your reading of how the image is stored is correct, but it's not the real issue, I'm afraid.

The question is more, why would you want this data. It doesn't make sense to boot from one kernel, suspend, boot from another kernel, suspend and then boot from the original kernel _unless_ in all of these cases, all filesystems are mounted read-only. If they're not mounted read-only, you'll get the cross linking and corruption Rob spoke of.

Whenever I switch from testing a 2.4 kernel to testing 2.6, I do a clean boot for precisely this reason. I'd love it if I could just suspend 2.4, boot the new 2.6 kernel, see if it suspends properly (to a different swap, of course) and then resume the original 2.4 kernel. But doing so would only work if I mounted 2.6 entirely read only, which is not what you seem to be planning.

Regards,

Nigel

Signature · 5 lines
Nigel Cunningham
495 St Georges Road South, Hastings 4201, New Zealand

Evolution (n): A hypothetical process whereby infinitely improbable events occur 
with alarming frequency, order arises from chaos, and no one is given credit.
author
#4 lore raw

Nigel, Rob,

Thanks for the explanations.

Shaheed

#5 lore raw
In reply to Nigel Cunningham
Quoted 6 lines · Nigel Cunningham

Whenever I switch from testing a 2.4 kernel to testing 2.6, I do a clean boot for precisely this reason. I'd love it if I could just suspend 2.4, boot the new 2.6 kernel, see if it suspends properly (to a different swap, of course) and then resume the original 2.4 kernel. But doing so would only work if I mounted 2.6 entirely read only, which is not what you seem to be planning.

You could of course have two completely different sets of root and swap partitions, if you have the disk space. (And either not sharing /home or unmount it before suspending...)

Assuming you have the disk space, of course. :)

Rob

#6 lore raw

Unfortunately, I don't :> I'm doing most of the development work on my Omnibook XE3, which has a 10GB HDD. Nevertheless, I fully agree with your point.

Regards,

Nigel

Quoted 16 lines · Rob Landley
Quoted 6 lines · Nigel Cunningham

Whenever I switch from testing a 2.4 kernel to testing 2.6, I do a clean boot for precisely this reason. I'd love it if I could just suspend 2.4, boot the new 2.6 kernel, see if it suspends properly (to a different swap, of course) and then resume the original 2.4 kernel. But doing so would only work if I mounted 2.6 entirely read only, which is not what you seem to be planning.

You could of course have two completely different sets of root and swap partitions, if you have the disk space. (And either not sharing /home or unmount it before suspending...)

Assuming you have the disk space, of course. :)

Rob

Signature · 5 lines
Nigel Cunningham
495 St Georges Road South, Hastings 4201, New Zealand

Evolution (n): A hypothetical process whereby infinitely improbable events occur 
with alarming frequency, order arises from chaos, and no one is given credit.
#7 lore raw
In reply to Shaheed

Hi!

Quoted 6 lines
Quoted 2 lines

B) A heuristic that looks at the mounted block devices for things that smell like a resume partition would actually be more robust in that case.

How about a static signature followed by a timestamp? That way, maybe we could have a resume menu like this:

Quoted 8 lines

/dev/hda3 (kernel 2.7.88, suspended on 01-04-2004 20:00:00) /dev/hda4 (kernel 2.8.99, suspended on 31-05-2005 20:00:00) *** Resume in 5..4..3..2..1..

with a 5 second countdown before it chooses the most recent? Or in Pavel's examples:

Erk! Nowhere to resume from!

If you select hda3 at this point, bye bye your data.

Pavel
PS: And I mean it. This is not just your average "few more files in lost+found" kind of corruption.

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]