From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbdCAKDt (ORCPT ); Wed, 1 Mar 2017 05:03:49 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:41323 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055AbdCAKDq (ORCPT ); Wed, 1 Mar 2017 05:03:46 -0500 Date: Wed, 1 Mar 2017 11:03:04 +0100 From: Peter Zijlstra To: Nikolay Borisov Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, ming.lei@canonical.com, minchan@kernel.org, mel@csn.ul.ie, junxiao.bi@oracle.com Subject: Re: [PATCH v2] lockdep: Teach lockdep about memalloc_noio_save Message-ID: <20170301100304.GI6500@twins.programming.kicks-ass.net> References: <1488354506-23774-1-git-send-email-nborisov@suse.com> <1488355140-24528-1-git-send-email-nborisov@suse.com> <20170301094657.GC6515@twins.programming.kicks-ass.net> <8ec973ad-ab96-ed0d-25ee-c4bee9ab5841@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ec973ad-ab96-ed0d-25ee-c4bee9ab5841@suse.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 01, 2017 at 11:57:13AM +0200, Nikolay Borisov wrote: > > > On 1.03.2017 11:46, Peter Zijlstra wrote: > > On Wed, Mar 01, 2017 at 09:59:00AM +0200, Nikolay Borisov wrote: > >> Commit 21caf2fc1931 ("mm: teach mm by current context info to not do I/O > >> during memory allocation") added the memalloc_noio_(save|restore) functions > >> to enable people to modify the MM behavior by disbaling I/O during memory > >> allocation. This prevents allocation paths recursing back into the filesystem > >> without explicitly changing the flags for every allocation site. Yet, lockdep > >> not being aware of that is prone to showing false positives. Fix this > >> by teaching it that the presence of PF_MEMALLOC_NOIO flag mean we are not > >> going to issue any I/O > > > > I'm not up to date on the specific, but GFP_IO is separate from GFP_FS. > > > > And MEMALLOC_NOIO only clears GFP_IO but leaves GFP_FS set. > > static inline gfp_t memalloc_noio_flags(gfp_t flags) > { > if (unlikely(current->flags & PF_MEMALLOC_NOIO)) > flags &= ~(__GFP_IO | __GFP_FS); > return flags; > } > Ah, so in the initial patch you referenced there was: +static inline gfp_t memalloc_noio_flags(gfp_t flags) +{ + if (unlikely(current->flags & PF_MEMALLOC_NOIO)) + flags &= ~__GFP_IO; + return flags; +} OK, so then this commit needs something like: Fixes: 934f3072c17c ("mm: clear __GFP_FS when PF_MEMALLOC_NOIO is set")