Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1404806
| From | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: zone_reclaimable() leads to livelock in __alloc_pages_slowpath() |
| Date | 2016-05-21 06:10 +0200 |
| Message-ID | <rB6oF-7ax-11@gated-at.bofh.it> (permalink) |
| References | <rAZdv-1Ze-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2016/05/21 5:28, Oleg Nesterov wrote:
> Hello,
>
> Recently I hit the problem, _sometimes_ the system just hangs in OOM situation.
> Surprisingly, this time OOM-killer is innocent ;) and finally I can reproduce
> this more-or-less reliably just running
>
> #include <stdlib.h>
> #include <string.h>
>
> int main(void)
> {
> for (;;) {
> void *p = malloc(1024 * 1024);
> memset(p, 0, 1024 * 1024);
> }
> }
>
> in a loop on the otherwise idle system. 512m RAM, one CPU (but CONFIG_SMP=y),
> no swap, and only one user-space process (apart from test-case above), /bin/sh
> runnning as init with pid==1. I am attaching my .config just in case, but I
> think the problem is not really specific to this configuration.
>
> --------------------------------------------------------------------------------
> It spins in __alloc_pages_slowpath() forever, __alloc_pages_may_oom() is never
> called, it doesn't react to SIGKILL, etc.
>
> This is because zone_reclaimable() is always true in shrink_zones(), and the
> problem goes away if I comment out this code
>
> if (global_reclaim(sc) &&
> !reclaimable && zone_reclaimable(zone))
> reclaimable = true;
>
> in shrink_zones() which otherwise returns this "true" every time, and thus
> __alloc_pages_slowpath() always sees did_some_progress != 0.
>
Michal Hocko's OOM detection rework patchset that removes that code was sent
to Linus 4 hours ago. ( https://marc.info/?l=linux-mm-commits&m=146378862415399 )
Please wait for a few days and try reproducing using linux.git .
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: zone_reclaimable() leads to livelock in __alloc_pages_slowpath() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-05-21 06:10 +0200 Re: zone_reclaimable() leads to livelock in __alloc_pages_slowpath() Oleg Nesterov <oleg@redhat.com> - 2016-05-22 23:20 +0200
csiph-web