Skip to contentSkip to conversation

additional oom-killer tuneable worth submitting?

DISCUSSION Al Boldi 2 participants 5 messages Dec 8, 2006

lore
Share & tools
lore

Al Boldi

author
#0 lore raw
Quoted 7 lines · Alan
Quoted 5 lines

On an embedded platform this allows the designer to engineer the system and protect critical apps based on their expected memory consumption. If one of those apps goes crazy and starts chewing additional memory then it becomes vulnerable to the oom killer while the other apps remain protected.

That is why we have no-overcommit support.

Alan, I think you know that this isn't really true, due to shared-libs.

Quoted 3 lines

Now there is an argument for
a meaningful rlimit-as to go with it, and together I think they do what you really need.

The problem with rlimit is that it works per process. Tuning this by hand may be awkward and/or wasteful. What we need is to rlimit on a global basis, by calculating an upperlimit dynamically, such as to avoid overcommit/OOM.

Thanks!

--
Al

#1 lore raw
Quoted 3 lines · On Fri, 8 Dec 2006 16:58:29 +0300 Al Boldi <[email protected]> wrote:
Quoted 1 line

That is why we have no-overcommit support.

Alan, I think you know that this isn't really true, due to shared-libs.

Shared libraries are correctly handled by no-overcommit and in fact they have almost zero impact on out of memory questions because the shared parts of the library are file backed and constant. That means they don't actually cost swap space.

Quoted 8 lines
Quoted 3 lines

Now there is an argument for
a meaningful rlimit-as to go with it, and together I think they do what you really need.

The problem with rlimit is that it works per process. Tuning this by hand may be awkward and/or wasteful. What we need is to rlimit on a global basis, by calculating an upperlimit dynamically, such as to avoid overcommit/OOM.

You've just described the existing no overcommit functionality, although you've forgotten to allow for pre-reserving of stacks and some other detail that has been found to make it work better as it has been refined.

Alan

author
#2 lore raw
Quoted 9 lines · Alan
Quoted 3 lines · Al Boldi
Quoted 1 line

That is why we have no-overcommit support.

Alan, I think you know that this isn't really true, due to shared-libs.

Shared libraries are correctly handled by no-overcommit and in fact they have almost zero impact on out of memory questions because the shared parts of the library are file backed and constant. That means they don't actually cost swap space.

What I understood from Arjan is that the problem isn't swapspace, but rather that shared-libs are implement via a COW trick, which always overcommits, no matter what.

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Now there is an argument for
a meaningful rlimit-as to go with it, and together I think they do what you really need.

Quoted 8 lines
Quoted 4 lines

The problem with rlimit is that it works per process. Tuning this by hand may be awkward and/or wasteful. What we need is to rlimit on a global basis, by calculating an upperlimit dynamically, such as to avoid overcommit/OOM.

You've just described the existing no overcommit functionality, although you've forgotten to allow for pre-reserving of stacks and some other detail that has been found to make it work better as it has been refined.

Are you saying there is some new no-overcommit functionality in 2.6.19, or has this been there before?

Thanks!

--
Al

#3 lore raw
Quoted 3 lines

What I understood from Arjan is that the problem isn't swapspace, but rather that shared-libs are implement via a COW trick, which always overcommits, no matter what.

The zero overcommit layer accounts address space not pages.

Quoted 2 lines

Are you saying there is some new no-overcommit functionality in 2.6.19, or has this been there before?

Red Hat Enterprise Linux for a very long time, got merged upstream a long long time ago to. Then got various fixes along the way. It's old functionality.

Alan

author
#4 lore raw
Quoted 5 lines · Alan
Quoted 3 lines

What I understood from Arjan is that the problem isn't swapspace, but rather that shared-libs are implement via a COW trick, which always overcommits, no matter what.

The zero overcommit layer accounts address space not pages.

So OOM can still occur?

Quoted 6 lines
Quoted 2 lines

Are you saying there is some new no-overcommit functionality in 2.6.19, or has this been there before?

Red Hat Enterprise Linux for a very long time, got merged upstream a long long time ago to. Then got various fixes along the way. It's old functionality.

That's what I thought, but it's still really easy to OOM even with no-overcommit.

Using ulimit -v [total VMsize/runqueue] seems to inhibit this rather effectively, but needs to be maintained dynamically per process.

Couldn't this be handled by the kernel?

Thanks!

--
Al