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
--
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!
> Hi Linus.
>
Well, you probably did want Linus to answer, but I see some new stuff
here.
> 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.
> - enhancements to refrigerator so it successfully freezes processes even
> under high load
This is bugfix.
> - 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.
> - 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
--
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.
On Sun, 2003-07-13 at 02:00, Pavel Machek wrote:
> Hi!
>
> > 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 :>
> > - 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.
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.
> > - 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...
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
--
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!
> Don't ask me why I'm awake at 3am. I don't know.
;-). Its 5pm here...
> > 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].
> > > - 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.
>
> 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.
Okay, that's sane approach to do it... But where do you store pointer
to pagedir?
> > > - 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...
>
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi.
On Sun, 2003-07-13 at 03:37, Pavel Machek wrote:
> > > > - 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...
> >
> > 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
--
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!
> > > > 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...
> > >
> > > 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.
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi.
On Sun, 2003-07-13 at 03:37, Pavel Machek wrote:
> 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
--
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 again.
On Sun, 2003-07-13 at 08:15, Pavel Machek wrote:
> 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
--
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.
On Saturday 12 July 2003 09:00 am, Pavel Machek wrote:
> > - 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!
> > 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> > > - 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.
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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> > 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
--
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
On Mon, 2003-07-14 at 07:31, Pavel Machek wrote:
> Hi!
>
> > > 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
--
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!
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> > > > > - 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)!
Only root can write to /proc/acpi/sleep, so there's no problem.
And having config variable just for escape during suspend is ugly.
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Pavel Machek wrote:
> > 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
Hi!
> > > 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> > 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
On Saturday 12 July 2003 23:37, Pavel Machek wrote:
> > > > - 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
--
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/
Nigel Cunningham wrote:
> On Sun, 2003-07-13 at 03:37, Pavel Machek wrote:
> > 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
Pavel Machek wrote:
> 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
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
On Mon, 2003-07-14 at 09:09, Pavel Machek wrote:
> Hi!
>
> > 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
--
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.
On Monday 14 July 2003 09:54, Nigel Cunningham wrote:
> 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
> APM) events :>
Sounds like a reasonable tradeoff
>
> Regards,
>
> Nigel
>
> On Mon, 2003-07-14 at 09:09, Pavel Machek wrote:
> > Hi!
> >
> > > 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 ;)
--
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!
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
On Sun, Jul 13, 2003 at 09:31:14PM +0200, Pavel Machek wrote:
> Hi!
>
> > > 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?
--
Vojtech Pavlik
SuSE Labs, SuSE CR
Hi!
> > 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Hi!
> 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
--
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.
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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
On Mon, Jul 14, 2003 at 10:18:04PM +0200, Pavel Machek wrote:
> Hi!
>
> > > 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...
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.
--
Vojtech Pavlik
SuSE Labs, SuSE CR
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
On Tue, 2003-07-15 at 08:18, Pavel Machek wrote:
> Hi!
>
> > > 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
--
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.
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
On Tue, 2003-07-15 at 08:29, Pavel Machek wrote:
> You won that bet. This kind of debugging stuff needs to be killed
> before merging with Linus.
> Pavel
--
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.
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
On Tue, 2003-07-15 at 08:10, Vojtech Pavlik wrote:
> How about making it to be any key?
--
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.
Without debugging code it could look more like..
> > [nigel@laptop-linux nigel]$ ls -l /proc/swsusp/
> > total 0
> > -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
> > -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.
> 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).
--
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.
On Mon, Jul 14, 2003 at 01:54:44PM +1200, Nigel Cunningham wrote:
> 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?
--
Vojtech Pavlik
SuSE Labs, SuSE CR
On Sun, Jul 13, 2003 at 02:35:17PM +0100, Jamie Lokier wrote:
> 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!
> > 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
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
Kent Borg wrote:
> On Sun, Jul 13, 2003 at 02:35:17PM +0100, Jamie Lokier wrote:
> > 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...
> > 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
On Wed, 2003-07-16 at 05:27, Jamie Lokier wrote:
> Kent Borg wrote:
> > On Sun, Jul 13, 2003 at 02:35:17PM +0100, Jamie Lokier wrote:
> > > 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...
>
> > > 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
--
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.