[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1306031411380.22083@chino.kir.corp.google.com>
Date: Mon, 3 Jun 2013 14:17:54 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Michal Hocko <mhocko@...e.cz>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
cgroups@...r.kernel.org
Subject: Re: [patch] mm, memcg: add oom killer delay
On Mon, 3 Jun 2013, Michal Hocko wrote:
> > What do you suggest when you read the "tasks" file and it returns -ENOMEM
> > because kmalloc() fails because the userspace oom handler's memcg is also
> > oom?
>
> That would require that you track kernel allocations which is currently
> done only for explicit caches.
>
That will not always be the case, and I think this could be a prerequisite
patch for such support that we have internally. I'm not sure a userspace
oom notifier would want to keep a preallocated buffer around that is
mlocked in memory for all possible lengths of this file.
> > Obviously it's not a situation we want to get into, but unless you
> > know that handler's exact memory usage across multiple versions, nothing
> > else is sharing that memcg, and it's a perfect implementation, you can't
> > guarantee it. We need to address real world problems that occur in
> > practice.
>
> If you really need to have such a guarantee then you can have a _global_
> watchdog observing oom_control of all groups that provide such a vague
> requirements for oom user handlers.
>
The whole point is to allow the user to implement their own oom policy.
If the policy was completely encapsulated in kernel code, we don't need to
ever disable the oom killer even with memory.oom_control. Users may
choose to kill the largest process, the newest process, the oldest
process, sacrifice children instead of parents, prevent forkbombs,
implement their own priority scoring (which is what we do), kill the
allocating task, etc.
To not merge this patch, I'd ask that you show an alternative that allows
users to implement their own userspace oom handlers and not require admin
intervention when things go wrong.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists