Thoughts wanted on merging Software Suspend enhancements
Hi Linus.
As you may know, there has been a lot of work done on the 2.4 version of software suspend. This includes:
- async i/o
- back out on errors rather than panicing (where possible)
- enhancements to refrigerator so it successfully freezes processes even under high load
- save a full image rather than freeing just about all the memory first
- highmem support
- image compression support
- swapfile support in progress
- nice display
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
- extensive debugging info that doesn't need to be compiled in and can be adjusted during the suspend cycle (very handy for diagnosing issues)
I'm wanting to get your thoughts on how we should go about merging it. I don't think these qualify as bug fixes, but current users (and I'm not excluding myself!) would certainly like to see the patch merged sooner rather than later. Would it be a good idea to seek to get Marcello and Andrew to take it into 2.4 and 2.6, and then aim for 2.[7|9]?
Regards,
Nigel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 2 lines
Hi Linus.
Well, you probably did want Linus to answer, but I see some new stuff here.
Quoted 5 lines
As you may know, there has been a lot of work done on the 2.4 version of software suspend. This includes:
- async i/o
- back out on errors rather than panicing (where possible)
If those panic()s happen for the users, then this is bugfix.
Quoted 2 lines
- enhancements to refrigerator so it successfully freezes processes even under high load
This is bugfix.
Quoted 4 lines
- save a full image rather than freeing just about all the memory first
- highmem support
- image compression support
- swapfile support in progress
This seems extremely hard to do right. If you can do it right and not rewrite half of kernel, that's okay, but I don't think you can do that.
Quoted 3 lines
- nice display
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Don't ask me why I'm awake at 3am. I don't know.
Quoted 7 lines · Pavel Machek
Hi!
Quoted 2 lines
Hi Linus.
Well, you probably did want Linus to answer, but I see some new stuff here.
Yeah, I did. But it wasn't going to happen :>
Quoted 7 lines
Quoted 4 lines
- save a full image rather than freeing just about all the memory first
- highmem support
- image compression support
- swapfile support in progressThis seems extremely hard to do right. If you can do it right and not rewrite half of kernel, that's okay, but I don't think you can do that.
I assume you mean swapfile only. The first two have been working for a while now. For swapfile support, my approach is simple. I'll store the info rw_swap_page_base calculates and save it in the pagedir, using it to read back the data at resume without requiring any knowledge of the filesystem. (Of course I'm assuming the data isn't compressed etc but since swapfiles work, this seems to be a reasonable assumption; I can always mirror changes in the swapfile code). I'll also take advantage of the fact that much of the pagedir data we're storing is very easily compressable itself to ensure that this doesn't result in severe bloat of the pagedirs. I've already got a little patch to test it the theory, and results look very encouraging but I won't try to explain it here. I'll just confuse the issue.
Quoted 7 lines
Quoted 3 lines
- nice display
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing EscapeThat seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Magic key? Do you mean a password? I suppose that could be a configuration option. I for one love being able to just press escape when I realise there was something I wanted to do before I shut the computer down, and I'll bet there'll be tons of people who think the same way. I could certainly go for a password option. The only question would be, how to configure the password. Perhaps a root-only proc entry?
Regards,
Nigel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 1 line
Don't ask me why I'm awake at 3am. I don't know.
;-). Its 5pm here...
Quoted 4 lines
Quoted 2 lines
Well, you probably did want Linus to answer, but I see some new stuff here.
Yeah, I did. But it wasn't going to happen :>
Well, Linus just tends to drop the mail. [Killed him from Cc].
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
- save a full image rather than freeing just about all the memory first
- highmem support
- image compression support
- swapfile support in progressThis seems extremely hard to do right. If you can do it right and not rewrite half of kernel, that's okay, but I don't think you can do that.
Quoted 12 lines
I assume you mean swapfile only. The first two have been working for a while now. For swapfile support, my approach is simple. I'll store the info
rw_swap_page_basecalculates and save it in the pagedir, using it to read back the data at resume without requiring any knowledge of the filesystem. (Of course I'm assuming the data isn't compressed etc but since swapfiles work, this seems to be a reasonable assumption; I can always mirror changes in the swapfile code). I'll also take advantage of the fact that much of the pagedir data we're storing is very easily compressable itself to ensure that this doesn't result in severe bloat of the pagedirs. I've already got a little patch to test it the theory, and results look very encouraging but I won't try to explain it here. I'll just confuse the issue.
Okay, that's sane approach to do it... But where do you store pointer to pagedir?
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
- nice display
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing EscapeThat seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Magic key? Do you mean a password? I suppose that could be a
Documentation/sysrq.txt. Magic sysrq driver will answer some interesting questions like "how to press esc on the serial line", etc, and it is also /proc configurable.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Hi.
Quoted 8 lines · Pavel Machek
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
- nice display
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing EscapeThat seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Quoted 5 lines
Quoted 1 line
Magic key? Do you mean a password? I suppose that could be a
Documentation/sysrq.txt. Magic sysrq driver will answer some interesting questions like "how to press esc on the serial line", etc, and it is also /proc configurable.
Oh so you just be having (eg) to press SysRq-Escape? Isn't that just security by obscurity? I'd rather go for the password idea. Sounds like there should be a few options for what is required to abort with one chosen at make config time.
1.0 tomorrow unless there's anything big in the meantime.
Nigel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Magic key? Do you mean a password? I suppose that could be a
Documentation/sysrq.txt. Magic sysrq driver will answer some interesting questions like "how to press esc on the serial line", etc, and it is also /proc configurable.Oh so you just be having (eg) to press SysRq-Escape? Isn't that just security by obscurity? I'd rather go for the password idea. Sounds like
No, you don't understand.
Magic SysRq is well known mechanism for torturing running kernel. Kernel hackers have it enabled, security-consious people have it disabled, and it is /proc-tweakable. It also works in cases like "the only keyboard on serial terminal", etc.
Quoted 1 line
1.0 tomorrow unless there's anything big in the meantime.
Don't let Esc issue block 1.0, but I do not want to see Esc in 2.5.X.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Hi again.
Quoted 6 lines · Pavel Machek
No, you don't understand.
Magic SysRq is well known mechanism for torturing running kernel. Kernel hackers have it enabled, security-consious people have it disabled, and it is /proc-tweakable. It also works in cases like "the only keyboard on serial terminal", etc.
Ah okay. So the security by obscurity bit was wrong, but the general idea of SysRq-Esc was right?
Regards,
Nigel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 9 lines
Quoted 6 lines
No, you don't understand.
Magic SysRq is well known mechanism for torturing running kernel. Kernel hackers have it enabled, security-consious people have it disabled, and it is /proc-tweakable. It also works in cases like "the only keyboard on serial terminal", etc.
Ah okay. So the security by obscurity bit was wrong, but the general idea of SysRq-Esc was right?
I guess so. Advantage is that people already know about Magic Sysrq and know how to disable it. (It would be something like Sysrq-E, you can't really use esc).
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Pavel" == Pavel Machek <[email protected]> writes:
Pavel> Hi!
Quoted 9 lines
No, you don't understand.
Magic SysRq is well known mechanism for torturing running kernel. Kernel hackers have it enabled, security-consious people have it disabled, and it is /proc-tweakable. It also works in cases like "the only keyboard on serial terminal", etc.
Quoted 3 lines
Ah okay. So the security by obscurity bit was wrong, but the general idea of SysRq-Esc was right?
Pavel> I guess so. Advantage is that people already know about Magic Pavel> Sysrq and know how to disable it. (It would be something like Pavel> Sysrq-E, you can't really use esc). Pavel
This discussion is strange. Nigel is right, if one starts suspending by mistake, one wants to be able to abort it easily. 'Esc' is just the perfect key for that. What's the point of hiding or obscuring it? I mean, why would you want to do that? You don't routinely 'hide' Ctrl-C for security reasons, do you?
--J.
Hi.
Quoted 2 lines · Pavel Machek
Okay, that's sane approach to do it... But where do you store pointer to pagedir?
I didn't answer this before. Sorry. Initially, you would still be expected to have a suspend partition, and hence it would still go in the header. Longer term, I'll have to learn more and see if there's a place we can use in the partition table or such like.
Regards,
Nigel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 7 lines
Quoted 2 lines
Okay, that's sane approach to do it... But where do you store pointer to pagedir?
I didn't answer this before. Sorry. Initially, you would still be expected to have a suspend partition, and hence it would still go in the header. Longer term, I'll have to learn more and see if there's a place we can use in the partition table or such like.
This needs to be thought out. Partition table is out of question because you kill the whole system if you get interrupted during partition table write.
First few KB of each ext2 filesystem are available, but I do not think we want to introduce such hacks.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 8 lines · Nigel Cunningham
Quoted 2 lines · Pavel Machek
Okay, that's sane approach to do it... But where do you store pointer to pagedir?
I didn't answer this before. Sorry. Initially, you would still be expected to have a suspend partition, and hence it would still go in the header. Longer term, I'll have to learn more and see if there's a place we can use in the partition table or such like.
You could also just make it a kernel command line option, for the bootloader to store. It's not like it needs to move each time you suspend - if you store the first block in a file in /boot.
-- Jamie
Hi!
Quoted 11 lines
Quoted 7 lines
Quoted 2 lines
Okay, that's sane approach to do it... But where do you store pointer to pagedir?
I didn't answer this before. Sorry. Initially, you would still be expected to have a suspend partition, and hence it would still go in the header. Longer term, I'll have to learn more and see if there's a place we can use in the partition table or such like.
You could also just make it a kernel command line option, for the bootloader to store. It's not like it needs to move each time you suspend - if you store the first block in a file in /boot.
Okay, so we would simply require bootloader to tell us "resume=/dev/hda@LBA=1234"? I guess that's quite clean, altrough it needs bootloader change. Queue that for 2.7.0 ;-).
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 7 lines · Pavel Machek
Quoted 3 lines
You could also just make it a kernel command line option, for the bootloader to store. It's not like it needs to move each time you suspend - if you store the first block in a file in /boot.
Okay, so we would simply require bootloader to tell us "resume=/dev/hda@LBA=1234"? I guess that's quite clean, altrough it needs bootloader change. Queue that for 2.7.0 ;-).
Actually it doesn't require a bootloader change, though that would be easiest for users :)
-- Jamie
Quoted 6 lines · Pavel Machek
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Dumb question applicable to 9x% of computers: how do you secure the suspend switch and OFF switch, not to mention the power plug or the battery?
As to security many portables have a bios password and no other passwords thereafter for the user account. The abort feature events could be enabled via swsusp proc entry mainly for (desktop) security. Also, then you ought to think about securing suspend events (don't swsusp the webserver please)!
In practice, when suspending, in many cases one would like to abort. Suspend should be abortable by ESC and post 1.0: the lid switch and/or suspend switch. If you think about it it makes sense to abort suspend instead of having to wait 15-40 seconds and reenter the bios password and wait another 10-30 seconds. (assuming 2.4 speeds)
The way I would use S3/S4 is reboot only for a new kernel, and really use the machine portably much more. S3 would be used for short suspends and S4 for longer suspends.
In short, this is an _important_ feature _as_ much as S3 and S4.
Regards
Michael
Signature · 9 lines
Powered by linux-2.5.75-mm1. Compiled with gcc-2.95-3 - mature and rock solid My current linux related activities: - 2.5 yenta_socket testing - Test development and testing of swsusp for 2.4/2.5 and ACPI S3 of 2.5 kernel - Everyday usage of 2.5 kernel More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt More info on swsusp: http://sourceforge.net/projects/swsusp/
Hi!
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Quoted 8 lines
Dumb question applicable to 9x% of computers: how do you secure the suspend switch and OFF switch, not to mention the power plug or the battery?
As to security many portables have a bios password and no other passwords thereafter for the user account. The abort feature events could be enabled via swsusp proc entry mainly for (desktop) security. Also, then you ought to think about securing suspend events (don't swsusp the webserver please)!
Only root can write to /proc/acpi/sleep, so there's no problem.
And having config variable just for escape during suspend is ugly.
Quoted 11 lines
In practice, when suspending, in many cases one would like to abort. Suspend should be abortable by ESC and post 1.0: the lid switch and/or suspend switch. If you think about it it makes sense to abort suspend instead of having to wait 15-40 seconds and reenter the bios password and wait another 10-30 seconds. (assuming 2.4 speeds)
The way I would use S3/S4 is reboot only for a new kernel, and really use the machine portably much more. S3 would be used for short suspends and S4 for longer suspends.
In short, this is an _important_ feature _as_ much as S3 and S4.
If you say that aborting with Esc is as important as having swsusp in the first place... that's not true.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 6 lines · Pavel Machek
Quoted 2 lines
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
In case when suspending (and interrupting suspend) matters most - laptops - Joe random user is the only user present. I myself would rather have an option to press ESC than remember what SysRq really maps to as by the time I would figure that out the laptop would already be suspended.
IMHO, an option to use ESC, probably compile time option, is a good thing.
Dmitry
Hi!
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
- user can abort at any time during suspend (oh, I forgot, I wanted to...) by just pressing Escape
That seems like missfeature. We don't want joe random user that is at the console to prevent suspend by just pressing Escape. Maybe magic key to do that would be acceptable...
Quoted 8 lines
In case when suspending (and interrupting suspend) matters most - laptops - Joe random user is the only user present. I myself would rather have an option to press ESC than remember what SysRq really maps to as by the time I would figure that out the laptop would already be suspended.
IMHO, an option to use ESC, probably compile time option, is a good thing.
No more compile time options, thanks.
And no escape. Doing something from keyboard is *ugly*. Magic sysrq is ugly, too, but its usefull enough to outweight that.
Hmm, I noticed that I'm making same mistake with shift during powerdown. I guess I should kill that hack.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 2 lines · Pavel Machek
And no escape. Doing something from keyboard is *ugly*. Magic sysrq is ugly, too, but its usefull enough to outweight that.
Can't you just use the Suspend button? :)
I'd be inclined to initiate suspend-to-disk when the laptop's lid is closed, or when I press the suspend button if ACPI would be so accomodating. After closing the lid, if I change my mind there's only two inputs I can do quickly: press the Suspend button, or open the lid. SysRq-Escape would take a couple of seconds longer due to needing to open the lid.
Of those, I'd be worried about the fragile lid switch occasionally bouncing as I moved the laptop, causing it to fail to suspend in my bag. The button is well protected.
-- Jamie
Hi!
Quoted 4 lines
Quoted 2 lines
And no escape. Doing something from keyboard is *ugly*. Magic sysrq is ugly, too, but its usefull enough to outweight that.
Can't you just use the Suspend button? :)
At least that's less ugly than Escape. If it is the same button that would wake machine up when it finished suspend... I guess that makes sense.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Escape is more intuitively obvious though - I would expect the suspend button to only start a suspend. And the idea of escape cancelling anything is well in-grained in peoples' minds.
Of course the other advantage is that reading lid & button switches adds more code (To implement and to configure - the functions of those keys ought to be optional?)
Regards,
Nigel
Quoted 11 lines · Pavel Machek
Hi!
Quoted 4 lines
Quoted 2 lines
And no escape. Doing something from keyboard is *ugly*. Magic sysrq is ugly, too, but its usefull enough to outweight that.
Can't you just use the Suspend button? :)
At least that's less ugly than Escape. If it is the same button that would wake machine up when it finished suspend... I guess that makes sense.
Pavel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 3 lines
Escape is more intuitively obvious though - I would expect the suspend button to only start a suspend. And the idea of escape cancelling anything is well in-grained in peoples' minds.
You did not initiate suspend from keyboard => you should not terminate it from keyboard.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Pavel" == Pavel Machek <[email protected]> writes:
Pavel> Hi!
Quoted 3 lines
Quoted 3 lines
Escape is more intuitively obvious though - I would expect the suspend button to only start a suspend. And the idea of escape cancelling anything is well in-grained in peoples' minds.
Pavel> You did not initiate suspend from keyboard => you should not Pavel> terminate it from keyboard.
Oh, come on. I usually initiate suspend by doing 'sh suspend' as root.
Besides, implementing swsusp support for ACPI events is IMHO right next to impossible (not to mention unbelievably messy), and that's what you'd need to have your power button abort the suspend process.
--J.
Okay.
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
Regards,
Nigel
Quoted 10 lines · Pavel Machek
Hi!
Quoted 3 lines
Escape is more intuitively obvious though - I would expect the suspend button to only start a suspend. And the idea of escape cancelling anything is well in-grained in peoples' minds.
You did not initiate suspend from keyboard => you should not terminate it from keyboard.
Pavel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Quoted 5 lines · Nigel Cunningham
Okay.
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4.
OK!
I won't add code to poll for ACPI (or
Quoted 1 line
APM) events :>
Sounds like a reasonable tradeoff
Quoted 15 lines
Regards,
Nigel
Quoted 9 lines · Pavel Machek
Hi!
Quoted 3 lines
Escape is more intuitively obvious though - I would expect the suspend button to only start a suspend. And the idea of escape cancelling anything is well in-grained in peoples' minds.
You did not initiate suspend from keyboard => you should not terminate it from keyboard.
Overruled ;)
Signature · 9 lines
Powered by linux-2.5.75-mm1. Compiled with gcc-2.95-3 - mature and rock solid My current linux related activities: - 2.5 yenta_socket testing - Test development and testing of swsusp for 2.4/2.5 and ACPI S3 of 2.5 kernel - Everyday usage of 2.5 kernel More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt More info on swsusp: http://sourceforge.net/projects/swsusp/
Hi!
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
At least no new proc entry, please. Make it depend on sysrq_enabled and disable it completely if sysrq support is not compiled in.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Pavel" == Pavel Machek <[email protected]> writes:
Pavel> Hi!
Quoted 4 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
Pavel> At least no new proc entry, please. Make it depend on Pavel> sysrq_enabled and disable it completely if sysrq support is not Pavel> compiled in.
Pavel, I disagree. This is important functionality. I *do* want to abort suspends by pressing 'Esc'.
I do not believe that hiding this gives you any extra security, and I do not believe that having it in is any kind of a problem. None of your arguments against it convinced me.
Please do not try to hide it and obscure it any more than it already is (Nigel has made this default to off for some reason).
--J.
Hi.
It defaults to disabled precisely because of Pavel's concerns.
Regards,
Nigel
Quoted 22 lines · Jan Rychter
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Pavel" == Pavel Machek <[email protected]> writes:
Pavel> Hi!
Quoted 4 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
Pavel> At least no new proc entry, please. Make it depend on Pavel>
sysrq_enabledand disable it completely if sysrq support is not Pavel> compiled in.Pavel, I disagree. This is important functionality. I *do* want to abort suspends by pressing 'Esc'.
I do not believe that hiding this gives you any extra security, and I do not believe that having it in is any kind of a problem. None of your arguments against it convinced me.
Please do not try to hide it and obscure it any more than it already is (Nigel has made this default to off for some reason).
--J.
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Quoted 4 lines · Nigel Cunningham
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 8 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Any user can load his own keymap, I believe... And I do not like having special /proc options for esc key...
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Hi.
I'm going to stand firm on this one, Pavel.
I think being able to cancel a suspend is a really useful feature, and I'll be surprised if we don't see Microsoft including it in their next version of Windows (perhaps I should take a patent out! :>)
That's not to say that I haven't listened to you, however. That's why I tightened up the requirements for using it yesterday. As to the extra proc entry, it's not a biggie: 2.4 swsusp now has it's own proc handling code which is easily extensible. I did this to make it easier to understand.
This...
[nigel@laptop-linux nigel]$ ls -l /proc/swsusp/
total 0
--w------- 1 root root 0 Jul 15 08:28 activate -rw------- 1 root root 0 Jul 15 08:28 async_io_limit -rw------- 1 root root 0 Jul 15 08:28 beeping -rw------- 1 root root 0 Jul 15 08:28 checkpage -rw------- 1 root root 0 Jul 15 08:28 debug_sections -rw------- 1 root root 0 Jul 15 08:28 default_console_level -rw------- 1 root root 0 Jul 15 08:28 enable_escape -rw------- 1 root root 0 Jul 15 08:28 image_size_limit -r-------- 1 root root 0 Jul 15 08:28 interface_version -r-------- 1 root root 0 Jul 15 08:28 last_result -rw------- 1 root root 0 Jul 15 08:28 log_everything -rw------- 1 root root 0 Jul 15 08:28 no_async_reads -rw------- 1 root root 0 Jul 15 08:28 no_async_writes -rw------- 1 root root 0 Jul 15 08:28 no_output -rw------- 1 root root 0 Jul 15 08:28 nopageset2 -rw------- 1 root root 0 Jul 15 08:28 pause_between_steps -rw------- 1 root root 0 Jul 15 08:28 progressbar_granularity_limit -rw------- 1 root root 0 Jul 15 08:28 reboot -rw------- 1 root root 0 Jul 15 08:28 slow -r-------- 1 root root 0 Jul 15 08:28 version
[nigel@laptop-linux nigel]$
is easier to understand and configure. The /proc/sys/kernel/swsusp interface is still there to make it easy to save & restore them all at once.
Regards,
Nigel
Quoted 14 lines · Pavel Machek
Hi!
Quoted 8 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Any user can load his own keymap, I believe... And I do not like having special /proc options for esc key...
Pavel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 5 lines
I'm going to stand firm on this one, Pavel.
I think being able to cancel a suspend is a really useful feature, and I'll be surprised if we don't see Microsoft including it in their next version of Windows (perhaps I should take a patent out! :>)
:-).
Quoted 32 lines
That's not to say that I haven't listened to you, however. That's why I tightened up the requirements for using it yesterday. As to the extra proc entry, it's not a biggie: 2.4 swsusp now has it's own proc handling code which is easily extensible. I did this to make it easier to understand.
This...
[nigel@laptop-linux nigel]$ ls -l
/proc/swsusp/
total 0
--w------- 1 root root 0 Jul 15 08:28 activate(quoted diff) +0
-19-rw------- 1 root root 0 Jul 15 08:28 async_io_limit -rw------- 1 root root 0 Jul 15 08:28 beeping -rw------- 1 root root 0 Jul 15 08:28 checkpage -rw------- 1 root root 0 Jul 15 08:28 debug_sections -rw------- 1 root root 0 Jul 15 08:28 default_console_level -rw------- 1 root root 0 Jul 15 08:28 enable_escape -rw------- 1 root root 0 Jul 15 08:28 image_size_limit -r-------- 1 root root 0 Jul 15 08:28 interface_version -r-------- 1 root root 0 Jul 15 08:28 last_result -rw------- 1 root root 0 Jul 15 08:28 log_everything -rw------- 1 root root 0 Jul 15 08:28 no_async_reads -rw------- 1 root root 0 Jul 15 08:28 no_async_writes -rw------- 1 root root 0 Jul 15 08:28 no_output -rw------- 1 root root 0 Jul 15 08:28 nopageset2 -rw------- 1 root root 0 Jul 15 08:28 pause_between_steps -rw------- 1 root root 0 Jul 15 08:28 progressbar_granularity_limit -rw------- 1 root root 0 Jul 15 08:28 reboot -rw------- 1 root root 0 Jul 15 08:28 slow -r-------- 1 root root 0 Jul 15 08:28 version[nigel@laptop-linux nigel]$
Quoted 3 lines
is easier to understand and configure. The
/proc/sys/kernel/swsuspinterface is still there to make it easy to save & restore them all at once.
Ouch.. But how many of these /proc tweaks need to stay there once debugging is done? I do not like any configuration options for swsusp... It should just work. [Okay, we probably need to have resume= parameter.]
For 2.4.X I don't care. For official tree, it has to "just work" with as little configuration as possible. [Besides enable_escape, what else might user want to tweak?]
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Without debugging code it could look more like..
Quoted 5 lines
Quoted 5 lines
[nigel@laptop-linux nigel]$ ls -l
/proc/swsusp/
total 0(quoted diff) +0
-3-rw------- 1 root root 0 Jul 15 08:28 enable_escape -rw------- 1 root root 0 Jul 15 08:28 image_size_limit -r-------- 1 root root 0 Jul 15 08:28 interface_version
Quoted 8 lines
Quoted 4 lines
(quoted diff) +0
-2-r-------- 1 root root 0 Jul 15 08:28 last_result -r-------- 1 root root 0 Jul 15 08:28 version[nigel@laptop-linux nigel]$
Ouch.. But how many of these /proc tweaks need to stay there once debugging is done? I do not like any configuration options for swsusp... It should just work. [Okay, we probably need to have resume= parameter.]
It does just work, but there is room for preferences too. I like flexibility, and try to build it into my code.
Quoted 3 lines
For 2.4.X I don't care. For official tree, it has to "just work" with as little configuration as possible. [Besides
enable_escape, what else might user want to tweak?]
The limit on the size of the image (they may want a smaller image than the amount of swap they have).
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Quoted 7 lines · Pavel Machek
Hi!
Quoted 5 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
Quoted 6 lines
Quoted 3 lines
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Any user can load his own keymap, I believe... And I do not like having special /proc options for esc key...
So what? He can press ctrl-alt-del or whatever if he has access to the keyboard anyway. Nevertheless I don't see any way to cause harm by cancelling a sw-suspend other than if a server was shutting down due to the UPS batteries being empty. And in that case the machine will be in a locked room anyway.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 18 lines · Pavel Machek
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Having listened to the arguments, I'll make pressing Escape to cancel the suspend a feature which defaults to being disabled and can be enabled via a proc entry in 2.4. I won't add code to poll for ACPI (or APM) events :>
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Quoted 8 lines
Quoted 2 lines
Any user can load his own keymap, I believe... And I do not like having special /proc options for esc key...
So what? He can press ctrl-alt-del or whatever if he has access to the keyboard anyway. Nevertheless I don't see any way to cause harm by cancelling a sw-suspend other than if a server was shutting down due to the UPS batteries being empty. And in that case the machine will be in a locked room anyway.
Quoted 5 lines
ctrl-alt-del maps to "echo you lost" on many machines. It just signals init, does nothing more.
That UPS is bad enough... It should be okay to have server locked but have its keyboard/monitor publicly available.
I'm very much sure this feature (having a server locked, while keyboard/screen is accessible) is much LESS useful than being able to stop an suspend in progress. That's if the suspend isn't lightning fast, of course, which is is not.
Unfortunately, while you can route the start-suspend command through userspace (init, whatever) like the reboot command is, but I fear when the suspend is in progress, it's not possible to talk to userspace anymore ...
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 24 lines
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
I'd suggest making it a mappable function in the keymap, like reboot is for example. Both for initiating and stopping the suspend. How about that?
Quoted 8 lines
Quoted 2 lines
Any user can load his own keymap, I believe... And I do not like having special /proc options for esc key...
So what? He can press ctrl-alt-del or whatever if he has access to the keyboard anyway. Nevertheless I don't see any way to cause harm by cancelling a sw-suspend other than if a server was shutting down due to the UPS batteries being empty. And in that case the machine will be in a locked room anyway.
Quoted 5 lines
ctrl-alt-del maps to "echo you lost" on many machines. It just signals init, does nothing more.
That UPS is bad enough... It should be okay to have server locked but have its keyboard/monitor publicly available.
I'm very much sure this feature (having a server locked, while keyboard/screen is accessible) is much LESS useful than being able to stop an suspend in progress. That's if the suspend isn't lightning fast, of course, which is is not.
Quoted 4 lines
Unfortunately, while you can route the start-suspend command through userspace (init, whatever) like the reboot command is, but I fear when the suspend is in progress, it's not possible to talk to userspace anymore ...
No, userspace is frozen at that point.
... and so I believe right thing is to
make magic sysrq combination for aborting suspend...
Signature · 2 lines
Pavel Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...
Quoted 2 lines · Pavel Machek
... and so I believe right thing is to make magic sysrq combination for aborting suspend...
Pavel,
SWSusp is mainly useful for desktop users. Although there may be cases where it is enabled on production machines, it should be aimed at desktop users as much as possible. The features to toggle reboot and abort suspend are really, really cool. And combining them with sysrq would just make them very very ugly. Someone mentioned the Gnome2 disaster, and I can only second that. Configurability IS important. And it should be easy as well (/proc is easy enough, good people or distributors can write a script and provide it to end users, etc.).
To make the abort of swsusp configurable is the best compromise you can have, IMHO. I don't know why you are so stubborn and don't try to see the 'normal' people (I'm not one of those, but I'm trying to understand!!).
Markus
Signature · 4 lines
__________________ /"\ Markus Gaugusch \ / ASCII Ribbon Campaign [email protected] X Against HTML Mail / \
Hi!
Quoted 15 lines
Quoted 2 lines
... and so I believe right thing is to make magic sysrq combination for aborting suspend...
Pavel,
SWSusp is mainly useful for desktop users. Although there may be cases where it is enabled on production machines, it should be aimed at desktop users as much as possible. The features to toggle reboot and abort suspend are really, really cool. And combining them with sysrq would just make them very very ugly. Someone mentioned the Gnome2 disaster, and I can only second that. Configurability IS important. And it should be easy as well (/proc is easy enough, good people or distributors can write a script and provide it to end users, etc.).
To make the abort of swsusp configurable is the best compromise you can have, IMHO. I don't know why you are so stubborn and don't try to see the 'normal' people (I'm not one of those, but I'm trying to understand!!).
At one point I was suggesting that Esc feature perhaps could be done by Esc and controlled same way magic sysrq is. No, nigel insisted that it has to have separate config option.
I believe that's simply stupid.
Anyway, escape key has pretty well defined meaning: send ^[ to the console. Altrough it might be nice for escape to return you back to LILO during early boot, we are not doing that.
Kernel should do its job and policy should be in userland. "Escape always stops suspend" is a security hole. => "Escape stops suspends" has no place in kernel.
You might want Esc to mean ^C when user accidentaly starts "cat", but you can't have that.
And now: special (and very ugly and very hacky) mechanism was developed to control kernel from console. It is called magic sysrq. Its ugly, but its also usefull. It is usable over serial line. Aborting suspend fits in there.
Esc controlled by magic sysrq proc control is extremely ugly, but at least it is not security hole any more, becuase user can already do bad stuff to the computer.
Anyway, this thread is long and boring... If you are trying to convince me with 10 000 mails "its important for users"... please don't do that.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Markus Gaugusch
Also, if we are talking security, someone with console access already has the machine in his hands - no need to be too paranoid I think.
Think of pressing the suspend button or closing the lid, and walking off while it is suspending.
-- Jamie
Quoted 10 lines · Pavel Machek
Hi!
Quoted 4 lines
Quoted 2 lines
And no escape. Doing something from keyboard is *ugly*. Magic sysrq is ugly, too, but its usefull enough to outweight that.
Can't you just use the Suspend button? :)
At least that's less ugly than Escape. If it is the same button that would wake machine up when it finished suspend... I guess that makes sense.
How about making it to be any key?
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
It's too easy to accidentally cancel a suspend then. There's also the fact that when debugging is compiled in, other keys are used to control the debug output: digits set the loglevel, R toggles rebooting and pause or break toggles pausing between steps (two keys because kdb might be using pause). I bet Pavel won't like them either, but I've found them invaluable for debugging and using SysRq combinations resulted in post-resume problems with the keyboard driver sometimes thinking SysRq was still being pressed.
Regards,
Nigel
Quoted 1 line · Vojtech Pavlik
How about making it to be any key?
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 6 lines
It's too easy to accidentally cancel a suspend then. There's also the fact that when debugging is compiled in, other keys are used to control the debug output: digits set the loglevel, R toggles rebooting and pause or break toggles pausing between steps (two keys because kdb might be using pause). I bet Pavel won't like them either, but I've found them
You won that bet. This kind of debugging stuff needs to be killed before merging with Linus.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Fine by me. The whole point is to make debugging easier, not to bloat the kernel. It would probably make sense to keep a debugging patch that could be used to reinsert the code if a tricky problem arose, but that's a long way off now, so not worth stressing about yet.
Regards,
Nigel
Quoted 3 lines · Pavel Machek
You won that bet. This kind of debugging stuff needs to be killed before merging with Linus.
Pavel
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Hi!
Quoted 4 lines
Fine by me. The whole point is to make debugging easier, not to bloat the kernel. It would probably make sense to keep a debugging patch that could be used to reinsert the code if a tricky problem arose, but that's a long way off now, so not worth stressing about yet.
Agreed, patch that adds debugging is definitely going to be usefull.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 2 lines · Jamie Lokier
I'd be inclined to initiate suspend-to-disk when the laptop's lid is closed
Please don't suspend my notebook when the lid is closed. I frequently want it running when closed. It is OK to turn off the backlight when closed (which my Vaio does), but don't show down my CPU or network just because I am not typing or looking at the screen.
-kb, the Kent who sometimes just closes his notebook before hopping off the bus, and who sometimes plugs it in to power and network when at home but leaves the lid closed.
Hi!
Quoted 7 lines
Quoted 2 lines
I'd be inclined to initiate suspend-to-disk when the laptop's lid is closed
Please don't suspend my notebook when the lid is closed. I frequently want it running when closed. It is OK to turn off the backlight when closed (which my Vaio does), but don't show down my CPU or network just because I am not typing or looking at the screen.
Of course, this *needs* to be configurable (== handled by userland). If you are using external keyboard/mouse you do not want your notebook open. I hate HP for putting powerswitch so that you have to open notebook to turn it on/off...
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Quoted 5 lines · Kent Borg
Quoted 2 lines · Jamie Lokier
I'd be inclined to initiate suspend-to-disk when the laptop's lid is closed
Please don't suspend my notebook when the lid is closed.
keep reading...
Quoted 1 line
Quoted 1 line
or when I press the suspend button
~~
I.e. switch between those two modes according to how the laptop is being used at the time. When travelling I use the lid switch to suspend (well I used to before I dropped it and broke the lid switch :) - at home I use the button.
I'd hope that suspend-to-disk could be activated in the same way (whatever way it is) that suspend-to-ram is now.
- Jamie
I already activate swsusp using either the sleep button ( /proc/acpi/events -> acpid -> script) or the gkrellm acpi addin that monitors battery levels. I'm sure acpid could do the lid switch too.
That's for initiating the suspend, of course. As I said, I'm not about to bloat swsusp further by adding code to test for the switches during suspend.
Regards,
Nigel
Quoted 21 lines · Jamie Lokier
Quoted 5 lines · Kent Borg
Quoted 2 lines · Jamie Lokier
I'd be inclined to initiate suspend-to-disk when the laptop's lid is closed
Please don't suspend my notebook when the lid is closed.
keep reading...
Quoted 1 line
Quoted 1 line
or when I press the suspend button
~~I.e. switch between those two modes according to how the laptop is being used at the time. When travelling I use the lid switch to suspend (well I used to before I dropped it and broke the lid switch :) - at home I use the button.
I'd hope that suspend-to-disk could be activated in the same way (whatever way it is) that suspend-to-ram is now.
- Jamie
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Jamie Lokier
Think of pressing the suspend button or closing the lid, and walking off while it is suspending.
please, continue...
Quoted 4 lines · Lyle Seaman
Quoted 2 lines
Think of pressing the suspend button or closing the lid, and walking off while it is suspending.
please, continue...
Haven't you ever pressed the "off" or "lock" button on a computer in a lab and walked away?
-- Jamie
Quoted 3 lines
Haven't you ever pressed the "off" or "lock" button on a computer in a lab and walked away?
Yes, I have, but that's not what I was driving at. The question is, what do you think is the difference between :
(a) pressing "suspend" and walking away, while being assured that suspend will complete and leave the system ... suspended, until someone triggers a "resume"
and
(b) pressing "suspend" and walking away, while allowing the possibility that someone might interrupt the suspend operation.
??
Personally, I don't see any difference.
Of course there's also the possibility that suspending might abort due to, say, being unable to freeze all the processes or having no swap available.
In a situation like that, I wouldn't walk away until I saw it power down. Besides, we're only talking about waiting 10 or 20 seconds in most cases (depending on the system's configuration). If you care that much about the security of your system, you'll be willing to wait.
Regards,
Nigel
Quoted 25 lines · Lyle Seaman
Quoted 2 lines
Haven't you ever pressed the "off" or "lock" button on a computer in a lab and walked away?
Yes, I have, but that's not what I was driving at. The question is, what do you think is the difference between :
(a) pressing "suspend" and walking away, while being assured that suspend will complete and leave the system ... suspended, until someone triggers a "resume"
and
(b) pressing "suspend" and walking away, while allowing the possibility that someone might interrupt the suspend operation.
??
Personally, I don't see any difference.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 6 lines
Nigel Cunningham 495 St Georges Road South, Hastings 4201, New Zealand You see, at just the right time, when we were still powerless, Christ died for the ungodly. -- Romans 5:6, NIV.
Quoted 6 lines · I wrote:
The question is, what do
you think is the difference between :(a) pressing "suspend" and walking away...
Personally, I don't see any difference.
I suppose you might have a BIOS password... okay.