Re: Out Of Memory in v. 2.1

Andrea Arcangeli (andrea@e-mind.com)
Wed, 7 Oct 1998 15:47:28 +0200 (CEST)


On Wed, 7 Oct 1998, Rik van Riel wrote:

>On Wed, 7 Oct 1998, Andrea Arcangeli wrote:
>
>> I think to have tested things very well these days and from practice
>> I know that when do_try_to_free_page returns 0 we are wasting our
>> time. Only 1 time over 300/400 do_try_to_free_page used by kswapd
>> return 1 after a 0.
>
>On _your_ machine, not on mine or on someone else's.
>from both mine, yours and eachother's. There just isn't
>anything you can say with certainty from tests on just your
>own machine.

Agreed, this is the reason I ask you to show me the numbers.

>Uhm, nope. I mean 2.0.8x, where x is something. You were there, I'm quite
>sure of that...

Yes I was there (but I didn' t know how the Linux mm subsystem works at
that time so I have not followed the discussion).

>> My point is that it' s so simple to kill the process that has
>> segfaulted that it _has_ to work.
>
>But what if no process pagefaults and the memory is allocated
>by the kernel?

This is allowed to happen and every piece of kernel must be able to live
with that. If you find a missing check for NULL after a
kmalloc/__get_free_pages/kmem_cache_alloc it' s a bug in such
piece of code according to me. The allocator is always allowed to return
NULL.

>Not unless it would use _all_ of memory.

This is possible if the code is under developement.

>My point is that root can do something like "cat
>/dev/random > /dev/mem" anyway, so we shouldn't
>care that much about what root can or can't do.

This has nothing to do with handling an oom condition. If a process goes
OOM the kernel _can_ be able to recover from it. If root run cat
/dev/random > /dev/mem the kernel _can't_ recover from such error. Since
the kernel can avoid fine a lock why not do that?

>Uhm, nope. With my patch and the SVGA fork-bomb, the
>machine would end up dead. With your patch and the
>SVGA fork-bomb, the machine would end up a little bit
>less dead, but just about as useless...

"a little bit less dead" means "the kernel is perfect".

As just said this is an userspace issue. If you don' t want to play with
userspace and iopl use XfreeFB (I never tried it btw).

Andrea[s] Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/