Re: [RFC PATCH 1/2] mm, vmscan: account the number of isolated pages per zone

From: Michal Hocko
Date: Mon Feb 06 2017 - 05:34:34 EST


On Sun 05-02-17 19:43:07, Tetsuo Handa wrote:
[...]
> Below one is also a loop. Maybe we can add __GFP_NOMEMALLOC to GFP_NOWAIT ?

No, GFP_NOWAIT is just too generic to use this flag.

> [ 257.781715] Out of memory: Kill process 5171 (a.out) score 842 or sacrifice child
> [ 257.784726] Killed process 5171 (a.out) total-vm:2177096kB, anon-rss:1476488kB, file-rss:4kB, shmem-rss:0kB
> [ 257.787691] a.out(5171): TIF_MEMDIE allocation: order=0 mode=0x1000200(GFP_NOWAIT|__GFP_NOWARN)
> [ 257.789789] CPU: 3 PID: 5171 Comm: a.out Not tainted 4.10.0-rc6-next-20170202+ #500
> [ 257.791784] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015
> [ 257.794700] Call Trace:
> [ 257.795690] dump_stack+0x85/0xc9
> [ 257.797224] __alloc_pages_slowpath+0xacb/0xe36
> [ 257.798612] __alloc_pages_nodemask+0x382/0x3d0
> [ 257.799942] alloc_pages_current+0x97/0x1b0
> [ 257.801236] __get_free_pages+0x14/0x50
> [ 257.802546] __tlb_remove_page_size+0x70/0xd0

This is bound to MAX_GATHER_BATCH_COUNT which shouldn't be a lot of
pages (20 or so). We could add __GFP_NOMEMALLOC into tlb_next_batch
but I am not entirely convinced it is really necessary.
--
Michal Hocko
SUSE Labs