Re: User space out of memory approach

Edjard Souza Mota
2005-01-11T10:05:47Z

Hi,

> Allowing userspace to tune is a great idea. However we cannot invoke
> userland at oom-time to make the decision, or it would be deadlock prone
> (userland may be swapped out or it might require minor allocations of
> memory, if we were to allow userspace to do the decision it would be
> required to be a mlockall userland and not allowed to do syscalls, and
> even then it could mess up with the stack or signal handlers).

Hmm, no it is not the case. The deamon application would start from the
boot. It only keeps the list of candidates whenever you're getting
close to red zone.
There is no deadlock.

Deamon just started at user space, and does only calculation. It doesn't
take decision at all. That OOM killer at kernel level who get the list
and chooses
who to shoot dead.

> So the safe thing to do is to assign different ratings to different userspace
> tasks. Of course this is inherited from the childs. That is a reasonable
> approach IMHO. Kurt wrote that patch, I only ported it to a more recent
> codebase.

Could be. Interesting idea. We shall keep thinking about it. Have you done
some experiment like that?

>
> This way you can rate your important services and the not important
> ones.
>
> Anyway as you've mentioned in a earlier email, there were more
> fundamental problems than the selection algorithm, the userspace rating
> was the lowest one in the prio list.
>

Yes, agreed. Our point was just to re-organize current OOM killer to release the
kernel from doing rating, which is not its task any way.

br

Edjard
--
"In a world without fences ... who needs Gates?"