I like to use suspend2 to do hibernation aka STD (suspend to disk) on Linux, and today, a very important step has been taken to start merge it into mainline kernel.
Rafael said
Now, I think that the hibernation should better be done completely in the
kernel, because that's just conceptually simpler, although some data exchange
with the user land may be acceptable for some optional fancy stuff. I'm also
tierd of the endless "to merge or not to merge suspend2" discussions that just
lead to nowhere. For these reasons I declare that I'm ready to cooperate with
Nigel on integrating as much of suspend2 as reasonably possible into the
existing infrastructure, under the following conditions:
- we don't remove the existing user-visible interfaces
- we work on one piece of code at a time
- we avoid code duplication, as much as possible
- we avoid using open-coded things, if possible
- if we don't agree on something, we ask someone wiser (volunteers welcome ;-))
If that's acceptable, we can start tomorrow. In the process, we can try to
separate the hibernation code paths from the s2ram ones, but that will require
a lot of knowledge about things that neither me nor Nigel, AFAICT, are very
familiar with, like writing device drivers.
And Nigel answered:
I don't want to remove user visible interfaces either (I understand that
you mean the ioctls by that?). Perhaps we can find a way to make them
still usable with a more in-kernel solution (ie some things become
noops?).
> - we work on one piece of code at a time
Sure. We should spend some time discussing and planning beforehand so we
don't waste time and effort writing and rewriting.
> - we avoid code duplication, as much as possible
No problem there.
> - we avoid using open-coded things, if possible
Regarding open-coded things, I assume you're referring to the extents. I
would argue that they're not open-coded because list.h implements doubly
linked lists, and extents use a singly linked list. That said, I suppose
we could make the extents doubly linked and use list.h, even though that
would be a waste of 4/8 bytes per extent.
> - if we don't agree on something, we ask someone wiser (volunteers welcome ;-))
Absolutely!