Re: [PATCH 1/4] mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC

2017-04-07 Thread Vlastimil Babka
On 04/05/2017 01:40 PM, Andrey Ryabinin wrote: > On 04/05/2017 10:46 AM, Vlastimil Babka wrote: >> The function __alloc_pages_direct_compact() sets PF_MEMALLOC to prevent >> deadlock during page migration by lock_page() (see the comment in >> __unmap_and_move()). Then it u

[PATCH 1/4] mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC

2017-04-05 Thread Vlastimil Babka
F_MEMALLOC is already set. Fixes: a8161d1ed609 ("mm, page_alloc: restructure direct compaction handling in slowpath") Reported-by: Andrey Ryabinin <aryabi...@virtuozzo.com> Signed-off-by: Vlastimil Babka <vba...@suse.cz> Cc: <sta...@vger.kernel.org> --- mm/page_alloc.c

[PATCH 0/4] more robust PF_MEMALLOC handling

2017-04-05 Thread Vlastimil Babka
xes (without the new helpers, to make backporting easier). Patch 2 introduces the new helpers, modelled after existing memalloc_noio_* and memalloc_nofs_* helpers, and converts mm core to use them. Patches 3 and 4 convert non-mm code. Based on next-20170404. Vlastimil Babka (4): mm: prevent potent

[PATCH 2/4] mm: introduce memalloc_noreclaim_{save,restore}

2017-04-05 Thread Vlastimil Babka
lar to the existing memalloc_noio_* and memalloc_nofs_* helpers. Convert existing setting/clearing of PF_MEMALLOC within mm to the new helpers. There are no known issues with the converted code, but the change makes it more robust. Suggested-by: Michal Hocko <mho...@suse.com> Signed-off-by:

Re: [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Vlastimil Babka
On 04/05/2017 01:36 PM, Richard Weinberger wrote: > Michal, > > Am 05.04.2017 um 13:31 schrieb Michal Hocko: >> On Wed 05-04-17 09:47:00, Vlastimil Babka wrote: >>> Nandsim has own functions set_memalloc() and clear_memalloc() for robust >>> setting and clea

[PATCH 3/4] treewide: convert PF_MEMALLOC manipulations to new helpers

2017-04-05 Thread Vlastimil Babka
We now have memalloc_noreclaim_{save,restore} helpers for robust setting and clearing of PF_MEMALLOC. Let's convert the code which was using the generic tsk_restore_flags(). No functional change. Signed-off-by: Vlastimil Babka <vba...@suse.cz> Cc: Josef Bacik <jba...@fb.com> Cc: Lee

[PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Vlastimil Babka
Nandsim has own functions set_memalloc() and clear_memalloc() for robust setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers. No functional change. Signed-off-by: Vlastimil Babka <vba...@suse.cz> Cc: Boris Brezillon <boris.brezil...@free-electrons.com>