Skip to contentSkip to conversation

Disable hibernate -- Live media shouldn't allow it?

DISCUSSION Phillip Susi 2 participants 5 messages May 15, 2013 – May 16, 2013 ACPI

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When booting from removable media, you may end up mounting a swap partition on an internal hard disk, thus enabling hibernation. Inadvertently hibernating ( perhaps in response to ACPI HOT event ) is silly since the system can not be resumed. Is there a flag somewhere to prevent hibernating? Shouldn't there be and shouldn't it be disabled by default?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJRlAjBAAoJEJrBOlT6nu75tD4IANMtQGPJfnwOrnwcL+pmxmRW 1Iq7EpwXtkxMbibcIiLIjtqfPXjupHQMQBxMoHvlZuISPv4lMChRqbM+wBEy5GfN waGcSilqbHurx+L4xSUE9UmZ6iUOWEvZreQRniTlrFbAV+pClYq2D0Ub2msOo1Ka Rg0zygVJSs0y6VrTZdUIbutiiGo24KFiJyTkErTnFr21QReIPd5Bq4zwVd+1I+UR oZY0z49ot8c+m2BhBZ8V6+H0do+zpmcvjmik3b6Dm8sFfGiCnjQVHhmc4tHNZfhS SnmW8dC+haR7kHAAFmIrd2RRbczD2H3XCM0/QvwVQ8ISz0h6Ejy1MTeNlW87XBA= =5nIU
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 9 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When booting from removable media, you may end up mounting a swap partition on an internal hard disk, thus enabling hibernation. Inadvertently hibernating ( perhaps in response to ACPI HOT event ) is silly since the system can not be resumed. Is there a flag somewhere to prevent hibernating? Shouldn't there be and shouldn't it be disabled by default?

I don't think we have a good definition of "removable media".

Also, you usually can remove a normally non-removable disk while hibernated, so I just don't see why we should disable it in any case.

That said, it is reasonable to expect live CDs not to configure the system to hibernate in response to overheating etc. But that's not a problem we can address in the kernel.

Thanks,
Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Rafael J. Wysocki

That said, it is reasonable to expect live CDs not to configure the system to hibernate in response to overheating etc. But that's not a problem we can address in the kernel.

How would that be configured? Initiating the hibernation in response to api HOT event is done in the kernel isn't it?

Setting the policy obviously isn't something that can be done in the kernel, but it should provide for the ability to have such a policy by having a knob user mode has to switch on when it thinks hibernation makes any kind of sense. Simply enabling a swap shouldn't be all it takes -- you should have to specify that yes, this swap is configured for hibernate/resume.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJRlB4sAAoJEJrBOlT6nu75oCwIAI2BmGmz/3gZjXuijTtDT90A ztcC04GltiCW6ciP8eq87L+dxogUoorR7lyJAeDycafEGscjbu9zaMFf6DL2SheH MKEWGg9Kk0j81gl2FDdkKrj6ZJzibcDuEFytcr9kLVE+je7vckUxDueBQvcy7ReK P6HYLgy6kEprvlAi8xmhv3CKZRmBi/gzsi6kxSTb32smqJ9l5qFfPSpL6paq6QbX 20rUvX0JHF5b8LHAsHgQfyS5DQ50tGVBKwE/X0+CRoVqPmS4tdJVvkp429SlwmJY FSPEN2aXESfwtRt/zk9AJRkZN9OCFQP44mVBSRsmjAN/lTTOjb35bdZPRBUP76o= =0vb+
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 10 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Rafael J. Wysocki

That said, it is reasonable to expect live CDs not to configure the system to hibernate in response to overheating etc. But that's not a problem we can address in the kernel.

How would that be configured? Initiating the hibernation in response to api HOT event is done in the kernel isn't it?

No, I don't think so. At least I'm not aware of that. Do you have any pointers to the kernel code doing that?

Quoted 6 lines

Setting the policy obviously isn't something that can be done in the kernel, but it should provide for the ability to have such a policy by having a knob user mode has to switch on when it thinks hibernation makes any kind of sense. Simply enabling a swap shouldn't be all it takes -- you should have to specify that yes, this swap is configured for hibernate/resume.

Actually, it is not all it takes. You need to point the hibernate code to the specific swap through the resume= kernel command line option (there is a default, though).

Thanks,
Rafael

Quoted 13 lines

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJRlB4sAAoJEJrBOlT6nu75oCwIAI2BmGmz/3gZjXuijTtDT90A ztcC04GltiCW6ciP8eq87L+dxogUoorR7lyJAeDycafEGscjbu9zaMFf6DL2SheH MKEWGg9Kk0j81gl2FDdkKrj6ZJzibcDuEFytcr9kLVE+je7vckUxDueBQvcy7ReK P6HYLgy6kEprvlAi8xmhv3CKZRmBi/gzsi6kxSTb32smqJ9l5qFfPSpL6paq6QbX 20rUvX0JHF5b8LHAsHgQfyS5DQ50tGVBKwE/X0+CRoVqPmS4tdJVvkp429SlwmJY FSPEN2aXESfwtRt/zk9AJRkZN9OCFQP44mVBSRsmjAN/lTTOjb35bdZPRBUP76o= =0vb+
-----END PGP SIGNATURE-----

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Rafael J. Wysocki

No, I don't think so. At least I'm not aware of that. Do you have any pointers to the kernel code doing that?

No, but I also can't see anything in user mode doing it either, which is why I'm asking. I assumed that since this is an emergency response required by the ACPI spec, that it would be implemented by the kernel ACPI driver.

Quoted 3 lines

Actually, it is not all it takes. You need to point the hibernate code to the specific swap through the resume= kernel command line option (there is a default, though).

That's needed to resume, but not to hibernate. Simply doing a swapon is enough to enable hibernating. Checking that you have a valid resume= kernel argument probably would be a sane thing to do before allowing hibernation, but this isn't currently the case.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRlOWYAAoJEJrBOlT6nu75C5AH/AylnOPsCPngyZtMGoyBNE5t IY/AM6YjVnuOuCYkIvQ973Vm6gIBaX4jP3SIAc35GEHWMwc+374DmDsuCsH3+hSh aT16qYIyx/hMgX8YN1qKoLSLoN3VwA0Lv1UV8aaAsmlJsX5mG4FtSpzPTtwBkIoj ctVJIfihpKgBJcbF0uvWyI8Z+2i9xa8jryd+Tl31K3Q4WLX/8XWjOtph9dcsXUXC 6En190gCz9dYeNN0937OLCXbmjOd0krGo7512OkfsygjAoPf589XzopS3BCLichM RQ8w295x8OhO5BZaKMUtHaxsLuj7v5X4BAqfAP83iNbR7Gj/nP7dQpExb8/y7xs= =O9Ks
-----END PGP SIGNATURE-----