From: Peter Zijlstra <peterz@infradead.org>
To: Nikolay Borisov <nborisov@suse.com>
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
Date: Wed, 1 Mar 2017 11:03:04 +0100 [thread overview]
Message-ID: <20170301100304.GI6500@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <8ec973ad-ab96-ed0d-25ee-c4bee9ab5841@suse.com>
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")
next prev parent reply other threads:[~2017-03-01 10:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 7:48 [PATCH] lockdep: Teach lockdep about memalloc_noio_save Nikolay Borisov
2017-03-01 7:59 ` [PATCH v2] " Nikolay Borisov
2017-03-01 9:46 ` Peter Zijlstra
2017-03-01 9:57 ` Nikolay Borisov
2017-03-01 10:03 ` Peter Zijlstra [this message]
2017-03-01 10:23 ` Vlastimil Babka
2017-03-01 10:22 ` [PATCH] " Vlastimil Babka
2017-03-01 10:31 ` Michal Hocko
2017-03-01 11:07 ` Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170301100304.GI6500@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=junxiao.bi@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=minchan@kernel.org \
--cc=ming.lei@canonical.com \
--cc=mingo@redhat.com \
--cc=nborisov@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox