low-memory testing

Albert Cahalan acahalan at gmail.com
Sun Oct 28 23:23:13 EDT 2007


On 10/28/07, Jim Gettys <jg at laptop.org> wrote:
> To begin with, I'd love to have someone working on a better OOM killer
> daemon than the default behavior the kernel provides. A fun project for
> the so inclined.

Current OOM score: /proc/*/oom_score
Adjustment: /proc/*/oom_adj

Adjustments run from -17 (never kill) to 15.

Starting each activity with oom_adj=15 would
be a good start.

> > I'm concerned about worse things, like data corruption.
> > Leaks and mere crashes are nothing in comparison.
> > Running out of memory makes allocations fail. When
> > that happens...
> >
> > Does JFFS2 corrupt itself? Reiserfs and ext3 have both
> > suffered from this problem.
> >
> The kernel *always* gets first dibs on memory, (it kills user
> space to get it).

That depends on flags passed to the allocator.
Many in-kernel allocations can not kill userspace.

> > Does the journal corrupt itself? I think it does, though I
> > certainly don't have decent proof yet.
>
> Create a big file, and see what happens.  Bug reports with recipes
> greatly appreciated.

File size should not matter. (if the journal keeps the whole
file in memory, then it can not handle large files at all)
What might cause trouble is to perform operations while
running low on memory. Killing the journal process from
the shell may be a decent way to test things.

> > Does a driver, in kernel or X, start a DMA to the wrong
> > location in memory? (address 0, a previous allocation
> > that has since been freed, or a clean page that was never
> > locked down and just got discarded by memory pressure)
>
> Not likely.

Got a better explanation for bug #4355 then?

That one really bothers me. It looks like it has
the potential for serious data destruction.

> > BTW, there is also a need for power-loss testing. Do we
> > get corruption if we interrupt etoys/squeak or the journal
> > at a bad moment? Power loss will certainly happen.
> > This could use an automated test rig.
> >
>
> The hope/intent is normal shutdown on low battery.  Apps get some
> warning.

There are like 4 bugs about unexpected shutdowns.
Kids will pull out batteries. Kids with missing batteries
will trip over the power cord, UL warning unheeded.
Kids with missing batteries will suffer blackouts.



More information about the Devel mailing list