mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Jiwei Sun <sunjw10@outlook.com>,
	chandan.babu@oracle.com, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, sunjw10@lenovo.com,
	ahuang12@lenovo.com, yi.zhang@redhat.com
Subject: Re: [PATCH] xfs: add __GFP_NOLOCKDEP when allocating memory in xfs_attr_shortform_list()
Date: Fri, 28 Jun 2024 10:01:18 -0700	[thread overview]
Message-ID: <20240628170118.GD612460@frogsfrogsfrogs> (raw)
In-Reply-To: <9b8357bf-a1bf-43d0-b617-030882540b34@sandeen.net>

On Fri, Jun 28, 2024 at 11:25:10AM -0500, Eric Sandeen wrote:
> On 6/27/24 8:12 AM, Jiwei Sun wrote:
> > From: Jiwei Sun <sunjw10@lenovo.com>
> > 
> > If the following configuration is set
> > CONFIG_LOCKDEP=y
> > 
> > The following warning log appears,
> 
> Was just about to send this. :)
> 
> I had talked to dchinner about this and he also suggested that this was 
> missed in the series that removed GFP_NOFS, i.e.
> 
> [PATCH 00/12] xfs: remove remaining kmem interfaces and GFP_NOFS usage
> at https://lore.kernel.org/linux-mm/20240622094411.GA830005@ceph-admin/T/
> 
> So, I think this could also use one or both of:
> 
> Fixes: 204fae32d5f7 ("xfs: clean up remaining GFP_NOFS users")
> Fixes: 94a69db2367e ("xfs: use __GFP_NOLOCKDEP instead of GFP_NOFS")
> 
> ...
> 
> > This is a false positive. If a node is getting reclaimed, it cannot be
> > the target of a flistxattr operation. Commit 6dcde60efd94 ("xfs: more
> > lockdep whackamole with kmem_alloc*") has the similar root cause.
> > 
> > Fix the issue by adding __GFP_NOLOCKDEP in order to shut up lockdep.
> > 
> > Signed-off-by: Jiwei Sun <sunjw10@lenovo.com>
> > Suggested-by: Adrian Huang <ahuang12@lenovo.com>
> > ---
> >  fs/xfs/xfs_attr_list.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
> > index 5c947e5ce8b8..506ade0befa4 100644
> > --- a/fs/xfs/xfs_attr_list.c
> > +++ b/fs/xfs/xfs_attr_list.c
> > @@ -114,7 +114,8 @@ xfs_attr_shortform_list(
> >  	 * It didn't all fit, so we have to sort everything on hashval.
> >  	 */
> >  	sbsize = sf->count * sizeof(*sbuf);
> > -	sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL);
> > +	sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL |
> > +			     __GFP_NOLOCKDEP);
> 
> Minor nitpick, style-wise we seem to do:
> 
>         sbp = sbuf = kmalloc(sbsize,
>                         GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);
> 
> in most other places, and not split the flags onto 2 lines, since you need
> to add a line anyway.
> 
> Otherwise,
> 
> Acked-by: Eric Sandeen <sandeen@redhat.com>

Hey, could you all please read the list before sending duplicate
patches?

https://lore.kernel.org/linux-xfs/20240622082631.2661148-1-leo.lilong@huawei.com/

--D

> >  	/*
> >  	 * Scan the attribute list for the rest of the entries, storing
> 
> 

  reply	other threads:[~2024-06-28 17:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 13:12 Jiwei Sun
2024-06-28 16:25 ` Eric Sandeen
2024-06-28 17:01   ` Darrick J. Wong [this message]
2024-06-28 23:31     ` Jiwei Sun

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=20240628170118.GD612460@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=ahuang12@lenovo.com \
    --cc=chandan.babu@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=sunjw10@lenovo.com \
    --cc=sunjw10@outlook.com \
    --cc=yi.zhang@redhat.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

all inboxes | Powered by JetHome®