Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754464AbdDEHsH (ORCPT ); Wed, 5 Apr 2017 03:48:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:51326 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753701AbdDEHrK (ORCPT ); Wed, 5 Apr 2017 03:47:10 -0400 From: Vlastimil Babka To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Mel Gorman , Johannes Weiner , linux-block@vger.kernel.org, nbd-general@lists.sourceforge.net, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, Vlastimil Babka , Andrey Ryabinin , Boris Brezillon , Chris Leech , "David S. Miller" , Eric Dumazet , Josef Bacik , Lee Duncan , Michal Hocko , Richard Weinberger , stable@vger.kernel.org Subject: [PATCH 0/4] more robust PF_MEMALLOC handling Date: Wed, 5 Apr 2017 09:46:56 +0200 Message-Id: <20170405074700.29871-1-vbabka@suse.cz> X-Mailer: git-send-email 2.12.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 30 Hi, this series aims to unify the setting and clearing of PF_MEMALLOC, which prevents recursive reclaim. There are some places that clear the flag unconditionally from current->flags, which may result in clearing a pre-existing flag. This already resulted in a bug report that Patch 1 fixes (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 potential recursive reclaim due to clearing PF_MEMALLOC mm: introduce memalloc_noreclaim_{save,restore} treewide: convert PF_MEMALLOC manipulations to new helpers mtd: nand: nandsim: convert to memalloc_noreclaim_*() drivers/block/nbd.c | 7 ++++--- drivers/mtd/nand/nandsim.c | 29 +++++++++-------------------- drivers/scsi/iscsi_tcp.c | 7 ++++--- include/linux/sched/mm.h | 12 ++++++++++++ mm/page_alloc.c | 10 ++++++---- mm/vmscan.c | 17 +++++++++++------ net/core/dev.c | 7 ++++--- net/core/sock.c | 7 ++++--- 8 files changed, 54 insertions(+), 42 deletions(-) -- 2.12.2