mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Tejun Heo <tj@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
	Hillf Danton <hdanton@sina.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Marco Elver <elver@google.com>,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	tglx@linutronix.de,
	syzbot <syzbot+6ea37e2e6ffccf41a7e6@syzkaller.appspotmail.com>
Subject: Re: [BUG] -next lockdep invalid wait context
Date: Fri, 8 Nov 2024 18:12:57 +0100	[thread overview]
Message-ID: <20241108171257.i0EpS9m3@linutronix.de> (raw)
In-Reply-To: <Zy5EIHUwoXjK1sAJ@slm.duckdns.org>

On 2024-11-08 07:02:24 [-1000], Tejun Heo wrote:
> Hello,
Hi,

> > @@ -223,12 +226,11 @@ int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen)
> >  int kernfs_path_from_node(struct kernfs_node *to, struct kernfs_node *from,
> >  			  char *buf, size_t buflen)
> >  {
> > -	unsigned long flags;
> >  	int ret;
> >  
> > -	read_lock_irqsave(&kernfs_rename_lock, flags);
> > +	rcu_read_lock();
> >  	ret = kernfs_path_from_node_locked(to, from, buf, buflen);
> > -	read_unlock_irqrestore(&kernfs_rename_lock, flags);
> > +	rcu_read_unlock();
> >  	return ret;
> >  }
> 
> The _locked suffix looks awkward afterwards. Given that there's no
> restriction on how the function is called anymore, maybe we can just
> collapse _locked bodies into the callers?

Sure.

> ...
> > diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
> > index 87c79d076d6d7..733d89de40542 100644
> > --- a/include/linux/kernfs.h
> > +++ b/include/linux/kernfs.h
> > @@ -199,8 +199,8 @@ struct kernfs_node {
> >  	 * never moved to a different parent, it is safe to access the
> >  	 * parent directly.
> >  	 */
> > -	struct kernfs_node	*parent;
> > -	const char		*name;
> > +	struct kernfs_node	__rcu *parent;
> > +	const char		__rcu *name;
> 
> ->parent doesn't have to be converted to RCU. As long as the node is
> accessible, the parent is guaranteed to be pinned and unchanged. We only
> need to RCUfy ->name.

I was uncertain about parent. But in that case, let me keep parent as-is
and just do name.
Thanks.

> Thanks.
> 

Sebastian

  reply	other threads:[~2024-11-08 17:13 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 21:05 Paul E. McKenney
2024-10-30 21:48 ` Vlastimil Babka
2024-10-30 22:34   ` Marco Elver
2024-10-30 23:04     ` Boqun Feng
2024-10-30 23:10     ` Paul E. McKenney
2024-10-31  7:21       ` Sebastian Andrzej Siewior
2024-10-31  7:35         ` Vlastimil Babka
2024-10-31  7:55           ` Sebastian Andrzej Siewior
2024-10-31  8:18             ` Vlastimil Babka
2024-11-01 17:14               ` Paul E. McKenney
2024-10-31 17:50             ` Paul E. McKenney
2024-11-01 19:50               ` Boqun Feng
2024-11-01 19:54                 ` [PATCH] scftorture: Use workqueue to free scf_check Boqun Feng
2024-11-01 23:35                   ` Paul E. McKenney
2024-11-03  3:35                     ` Boqun Feng
2024-11-03 15:03                       ` Paul E. McKenney
2024-11-04 10:50                         ` [PATCH 1/2] scftorture: Move memory allocation outside of preempt_disable region Sebastian Andrzej Siewior
2024-11-04 10:50                           ` [PATCH 2/2] scftorture: Use a lock-less list to free memory Sebastian Andrzej Siewior
2024-11-05  1:00                             ` Boqun Feng
2024-11-07 11:21                               ` Sebastian Andrzej Siewior
2024-11-07 14:08                                 ` Paul E. McKenney
2024-11-07 14:43                                   ` Sebastian Andrzej Siewior
2024-11-07 14:59                                     ` Paul E. McKenney
2024-11-02  0:12         ` [BUG] -next lockdep invalid wait context Hillf Danton
2024-11-02  0:45           ` Boqun Feng
2024-11-04 18:08             ` Tejun Heo
2024-11-05  9:37               ` Vlastimil Babka
2024-11-08 10:05               ` Sebastian Andrzej Siewior
2024-11-08 17:02                 ` Tejun Heo
2024-11-08 17:12                   ` Sebastian Andrzej Siewior [this message]
2024-11-08 22:24                   ` [PATCH] kernfs: Use RCU for kernfs_node::name lookup Sebastian Andrzej Siewior
2024-11-08 22:31                     ` Tejun Heo
2024-11-11 17:04                       ` Sebastian Andrzej Siewior
2024-11-12 19:02                         ` Tejun Heo
2024-11-13  7:58                           ` Sebastian Andrzej Siewior
2024-11-08 23:16                     ` Hillf Danton
2024-11-08 23:48                       ` [syzbot] [kernfs?] WARNING: locking bug in kernfs_path_from_node syzbot
2024-11-11  4:49                     ` [PATCH] kernfs: Use RCU for kernfs_node::name lookup kernel test robot

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=20241108171257.i0EpS9m3@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=boqun.feng@gmail.com \
    --cc=elver@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=syzbot+6ea37e2e6ffccf41a7e6@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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®