I didn't realize this was a discussion item. I thought the options were
clear, for some filesystem types you can mount them read-only, but for
ext3 (and possilby other less common ones) you just plain cannot touch
them.
we all agree that tasks cannot run during the suspend-to-ram state, but
the disagreement is over what this means
at one extreme it could mean that you would need the full freezer as per
the current suspend projects.
at the other extreme it could mean that all that's needed is to invoke the
suspend-to-ram routine before anything else on the suspended kernel on the
return from the save and restore kernel.
we just need to figure out which it is (or if it's somewhere in between).
not if the filesystem is mounted read-only (except on ext3)
I disagree a little bit.
first off, only the suspending kernel can know what can be freed and what
is needed to do so (remember this is kernel internals, it can change from
patch to patch, let alone version to version)
second, if you have a lot of memory to free, and you can't just throw away
caches to do so, you don't know what is going to be involved in freeing
the memory, it's very possilbe that it is going to involve userspace, so
you can't freeze any significant portion of the system, so you can't
eliminate all chance of races
what you can do is
1. try to free stuff
2. stop the system and account for memory, is enough free
if not goto 1
if userspace is dirtying memory fast enough, or is just useing enough
memory that you can't meet your limit you just won't be able to suspend.
but under any other conditions you will eventually get enough memory free.
so try several times and if you still fail tell the user they have too
much stuff running and they need to kill something.
this doesn't make sense, 20% of 2G is 400M, if you can't make a kernel and
userspace that can run in 400M you have a serious problem.
even if you wanted to save 99% of RAM on a 2G system, you have 20M of ram
to play with, which should easily be enough.
remember, linux runs on really small systems as well, and while you do
have to load some drivers for the big system, there are a lot of other
things that aren't needed.
becouse you say that the current methods won't work without ACPI support.
David Lang
-