Re: [Nbd] [PATCH 2/4] mm: introduce memalloc_noreclaim_{save, restore}
- To: "'Vlastimil Babka'" <vbabka@...1290...>, "'Andrew Morton'" <akpm@...133...>
- Cc: nbd-general@lists.sourceforge.net, 'Michal Hocko' <mhocko@...1750...>, linux-scsi@...25..., netdev@...25..., linux-kernel@...25..., 'Michal Hocko' <mhocko@...1285...>, linux-block@...25..., linux-mm@...1312..., 'Johannes Weiner' <hannes@...1554...>, open-iscsi@...2887..., 'Mel Gorman' <mgorman@...2888...>
- Subject: Re: [Nbd] [PATCH 2/4] mm: introduce memalloc_noreclaim_{save, restore}
- From: "Hillf Danton" <hillf.zj@...2873...>
- Date: Fri, 07 Apr 2017 15:38:43 +0800
- Message-id: <[🔎] 092401d2af71$fc320ef0$f4962cd0$@alibaba-inc.com>
- Reply-to: Hillf Danton <hillf.zj@...2873...>
- In-reply-to: <20170405074700.29871-3-vbabka@...1290...>
- References: <20170405074700.29871-1-vbabka@...1290...> <20170405074700.29871-3-vbabka@...1290...>
On April 05, 2017 3:47 PM Vlastimil Babka wrote:
>
> The previous patch has shown that simply setting and clearing PF_MEMALLOC in
> current->flags can result in wrongly clearing a pre-existing PF_MEMALLOC flag
> and potentially lead to recursive reclaim. Let's introduce helpers that support
> proper nesting by saving the previous stat of the flag, similar 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 <mhocko@...1750...>
> Signed-off-by: Vlastimil Babka <vbabka@...1290...>
> ---
Acked-by: Hillf Danton <hillf.zj@...2873...>
Reply to: