From: Joel Fernandes <joel@joelfernandes.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: rcu@vger.kernel.org, rushikesh.s.kadam@intel.com,
urezki@gmail.com, neeraj.iitr10@gmail.com, frederic@kernel.org,
rostedt@goodmis.org
Subject: Re: [RFC v1 05/14] fs: Move call_rcu() to call_rcu_lazy() in some paths
Date: Sat, 14 May 2022 14:40:25 +0000 [thread overview]
Message-ID: <Yn+/WeuADEExfkwq@google.com> (raw)
In-Reply-To: <20220513000717.GY1790663@paulmck-ThinkPad-P17-Gen-1>
On Thu, May 12, 2022 at 05:07:17PM -0700, Paul E. McKenney wrote:
> On Thu, May 12, 2022 at 03:04:33AM +0000, Joel Fernandes (Google) wrote:
> > This is required to prevent callbacks triggering RCU machinery too
> > quickly and too often, which adds more power to the system.
> >
> > When testing, we found that these paths were invoked often when the
> > system is not doing anything (screen is ON but otherwise idle).
> >
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> Some of these callbacks do additional work. I don't immediately see a
> problem, but careful and thorough testing is required.
Full agreed, fwiw I did choose several of them by looking at what the
callback did but I agree additional review and testing is needed.
thanks,
- Joel
>
> Thanx, Paul
>
> > ---
> > fs/dcache.c | 4 ++--
> > fs/eventpoll.c | 2 +-
> > fs/file_table.c | 3 ++-
> > fs/inode.c | 2 +-
> > 4 files changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/fs/dcache.c b/fs/dcache.c
> > index c84269c6e8bf..517e02cde103 100644
> > --- a/fs/dcache.c
> > +++ b/fs/dcache.c
> > @@ -366,7 +366,7 @@ static void dentry_free(struct dentry *dentry)
> > if (unlikely(dname_external(dentry))) {
> > struct external_name *p = external_name(dentry);
> > if (likely(atomic_dec_and_test(&p->u.count))) {
> > - call_rcu(&dentry->d_u.d_rcu, __d_free_external);
> > + call_rcu_lazy(&dentry->d_u.d_rcu, __d_free_external);
> > return;
> > }
> > }
> > @@ -374,7 +374,7 @@ static void dentry_free(struct dentry *dentry)
> > if (dentry->d_flags & DCACHE_NORCU)
> > __d_free(&dentry->d_u.d_rcu);
> > else
> > - call_rcu(&dentry->d_u.d_rcu, __d_free);
> > + call_rcu_lazy(&dentry->d_u.d_rcu, __d_free);
> > }
> >
> > /*
> > diff --git a/fs/eventpoll.c b/fs/eventpoll.c
> > index e2daa940ebce..10a24cca2cff 100644
> > --- a/fs/eventpoll.c
> > +++ b/fs/eventpoll.c
> > @@ -728,7 +728,7 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)
> > * ep->mtx. The rcu read side, reverse_path_check_proc(), does not make
> > * use of the rbn field.
> > */
> > - call_rcu(&epi->rcu, epi_rcu_free);
> > + call_rcu_lazy(&epi->rcu, epi_rcu_free);
> >
> > percpu_counter_dec(&ep->user->epoll_watches);
> >
> > diff --git a/fs/file_table.c b/fs/file_table.c
> > index 7d2e692b66a9..415815d3ef80 100644
> > --- a/fs/file_table.c
> > +++ b/fs/file_table.c
> > @@ -56,7 +56,8 @@ static inline void file_free(struct file *f)
> > security_file_free(f);
> > if (!(f->f_mode & FMODE_NOACCOUNT))
> > percpu_counter_dec(&nr_files);
> > - call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
> > +
> > + call_rcu_lazy(&f->f_u.fu_rcuhead, file_free_rcu);
> > }
> >
> > /*
> > diff --git a/fs/inode.c b/fs/inode.c
> > index 63324df6fa27..b288a5bef4c7 100644
> > --- a/fs/inode.c
> > +++ b/fs/inode.c
> > @@ -312,7 +312,7 @@ static void destroy_inode(struct inode *inode)
> > return;
> > }
> > inode->free_inode = ops->free_inode;
> > - call_rcu(&inode->i_rcu, i_callback);
> > + call_rcu_lazy(&inode->i_rcu, i_callback);
> > }
> >
> > /**
> > --
> > 2.36.0.550.gb090851708-goog
> >
next prev parent reply other threads:[~2022-05-14 14:40 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 3:04 [RFC v1 00/14] Implement call_rcu_lazy() and miscellaneous fixes Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 01/14] rcu: Add a lock-less lazy RCU implementation Joel Fernandes (Google)
2022-05-12 23:56 ` Paul E. McKenney
2022-05-14 15:08 ` Joel Fernandes
2022-05-14 16:34 ` Paul E. McKenney
2022-05-27 23:12 ` Joel Fernandes
2022-05-28 17:57 ` Paul E. McKenney
2022-05-30 14:48 ` Joel Fernandes
2022-05-30 16:42 ` Paul E. McKenney
2022-05-31 2:12 ` Joel Fernandes
2022-05-31 4:26 ` Paul E. McKenney
2022-05-31 16:11 ` Joel Fernandes
2022-05-31 16:45 ` Paul E. McKenney
2022-05-31 18:51 ` Joel Fernandes
2022-05-31 19:25 ` Paul E. McKenney
2022-05-31 21:29 ` Joel Fernandes
2022-05-31 22:44 ` Joel Fernandes
2022-06-01 14:24 ` Frederic Weisbecker
2022-06-01 16:17 ` Paul E. McKenney
2022-06-01 19:09 ` Joel Fernandes
2022-05-17 9:07 ` Uladzislau Rezki
2022-05-30 14:54 ` Joel Fernandes
2022-06-01 14:12 ` Frederic Weisbecker
2022-06-01 19:10 ` Joel Fernandes
2022-05-12 3:04 ` [RFC v1 02/14] workqueue: Add a lazy version of queue_rcu_work() Joel Fernandes (Google)
2022-05-12 23:58 ` Paul E. McKenney
2022-05-14 14:44 ` Joel Fernandes
2022-05-12 3:04 ` [RFC v1 03/14] block/blk-ioc: Move call_rcu() to call_rcu_lazy() Joel Fernandes (Google)
2022-05-13 0:00 ` Paul E. McKenney
2022-05-12 3:04 ` [RFC v1 04/14] cred: " Joel Fernandes (Google)
2022-05-13 0:02 ` Paul E. McKenney
2022-05-14 14:41 ` Joel Fernandes
2022-05-12 3:04 ` [RFC v1 05/14] fs: Move call_rcu() to call_rcu_lazy() in some paths Joel Fernandes (Google)
2022-05-13 0:07 ` Paul E. McKenney
2022-05-14 14:40 ` Joel Fernandes [this message]
2022-05-12 3:04 ` [RFC v1 06/14] kernel: Move various core kernel usages to call_rcu_lazy() Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 07/14] security: Move call_rcu() " Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 08/14] net/core: " Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 09/14] lib: " Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 10/14] kfree/rcu: Queue RCU work via queue_rcu_work_lazy() Joel Fernandes (Google)
2022-05-13 0:12 ` Paul E. McKenney
2022-05-13 14:55 ` Uladzislau Rezki
2022-05-14 14:33 ` Joel Fernandes
2022-05-14 19:10 ` Uladzislau Rezki
2022-05-12 3:04 ` [RFC v1 11/14] i915: Move call_rcu() to call_rcu_lazy() Joel Fernandes (Google)
2022-05-12 3:04 ` [RFC v1 12/14] rcu/kfree: remove useless monitor_todo flag Joel Fernandes (Google)
2022-05-13 14:53 ` Uladzislau Rezki
2022-05-14 14:35 ` Joel Fernandes
2022-05-14 19:48 ` Uladzislau Rezki
2022-05-12 3:04 ` [RFC v1 13/14] rcu/kfree: Fix kfree_rcu_shrink_count() return value Joel Fernandes (Google)
2022-05-13 14:54 ` Uladzislau Rezki
2022-05-14 14:34 ` Joel Fernandes
2022-05-12 3:04 ` [RFC v1 14/14] DEBUG: Toggle rcu_lazy and tune at runtime Joel Fernandes (Google)
2022-05-13 0:16 ` Paul E. McKenney
2022-05-14 14:38 ` Joel Fernandes
2022-05-14 16:21 ` Paul E. McKenney
2022-05-12 3:17 ` [RFC v1 00/14] Implement call_rcu_lazy() and miscellaneous fixes Joel Fernandes
2022-05-12 13:09 ` Uladzislau Rezki
2022-05-12 13:56 ` Uladzislau Rezki
2022-05-12 14:03 ` Joel Fernandes
2022-05-12 14:37 ` Uladzislau Rezki
2022-05-12 16:09 ` Joel Fernandes
2022-05-12 16:32 ` Uladzislau Rezki
[not found] ` <Yn5e7w8NWzThUARb@pc638.lan>
2022-05-13 14:51 ` Joel Fernandes
2022-05-13 15:43 ` Uladzislau Rezki
2022-05-14 14:25 ` Joel Fernandes
2022-05-14 19:01 ` Uladzislau Rezki
2022-08-09 2:25 ` Joel Fernandes
2022-05-13 0:23 ` Paul E. McKenney
2022-05-13 14:45 ` Joel Fernandes
2022-06-13 18:53 ` Joel Fernandes
2022-06-13 22:48 ` Paul E. McKenney
2022-06-16 16:26 ` Joel Fernandes
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=Yn+/WeuADEExfkwq@google.com \
--to=joel@joelfernandes.org \
--cc=frederic@kernel.org \
--cc=neeraj.iitr10@gmail.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=rushikesh.s.kadam@intel.com \
--cc=urezki@gmail.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