lkml.org 
[lkml]   [2010]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] oom-kill: add lowmem usage aware oom kill handling
On Thu, 28 Jan 2010, Alan Cox wrote:

> > Now, /proc/<pid>/oom_score and /proc/<pid>/oom_adj are used by servers.
>
> And embedded, and some desktops (including some neat experimental hacks
> where windows slowly get to be bigger bigger oom targes the longer
> they've been non-focussed)
>

Right, oom_adj is used much more widely than described.

> I can't help feeling this is the wrong approach. IFF we are running out
> of low memory pages then killing stuff for that reason is wrong to begin
> with except in extreme cases and those extreme cases are probably also
> cases the kill won't help.
>
> If we have a movable user page (even an mlocked one) then if there is
> space in other parts of memory (ie the OOM is due to a single zone
> problem) we should *never* be killing in the first place, we should be
> moving the page. The mlock case is a bit hairy but the non mlock case is
> exactly the same sequence of operations as a page out and page in
> somewhere else skipping the widdling on the disk bit in the middle.
>

Mel Gorman's memory compaction patchset will preempt direct reclaim and
the oom killer if it can defragment zones by page migration such that a
higher order allocation would now succeed.

In this specific context, both compaction and direct reclaim will have
failed so the oom killer is the only alternative. For __GFP_NOFAIL,
that's required. However, there has been some long-standing debate (and
not only for lowmem, but for all oom conditions) about when the page
allocator should simply return NULL. We've always killed something on
blocking allocations to favor current at the expense of other memory hogs,
but that may be changed soon: it may make sense to defer oom killing
completely unless the badness() score reaches a certain threshold such
that memory leakers really can be dealt with accordingly.

In the lowmem case, it certainly seems plausible to use the same behavior
that we currently do for mempolicy-constrained ooms: kill current.


\
 
 \ /
  Last update: 2010-01-28 02:03    [from the cache]
©2003-2011 Jasper Spaans