Re: User space out of memory approach

From: Andrea Arcangeli
Date: Tue Jan 11 2005 - 04:57:53 EST


On Tue, Jan 11, 2005 at 10:30:46AM +0100, Thomas Gleixner wrote:
> > > > 2) killing just gets the first candidate from the list and kills it.
> > > > No need to calculate
> > > > at kernel level.
>
> So I need a userspace change in order to solve a kernel problem ?

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). 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.

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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/