From: Frederic Weisbecker <frederic@kernel.org>
To: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: linux-kernel@vger.kernel.org, paulmck@kernel.org,
Rushikesh S Kadam <rushikesh.s.kadam@intel.com>,
"Uladzislau Rezki (Sony)" <urezki@gmail.com>,
Neeraj upadhyay <neeraj.iitr10@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>, rcu <rcu@vger.kernel.org>,
vineeth@bitbyteword.org
Subject: Re: [PATCH v4 00/14] Implement call_rcu_lazy() and miscellaneous fixes
Date: Mon, 29 Aug 2022 15:40:45 +0200 [thread overview]
Message-ID: <20220829134045.GA54589@lothringen> (raw)
In-Reply-To: <20220819204857.3066329-1-joel@joelfernandes.org>
On Fri, Aug 19, 2022 at 08:48:43PM +0000, Joel Fernandes (Google) wrote:
> Refresh tested on real ChromeOS userspace and hardware, passes boot time tests
> and rcuscale tests.
>
> Fixes on top of v3:
> - Fix boot issues due to a race in the lazy RCU logic which caused a missed
> wakeup of the RCU GP thread, causing synchronize_rcu() to stall.
> - Fixed trace_rcu_callback tracepoint
>
> I tested power previously [1], I am in the process of testing power again but I
> wanted share my latest code as others who are testing power as well could use
> the above fixes.
Your patch is very likely to be _generally_ useful and therefore,
the more I look into this, the more I wonder if it is a good idea to rely on
bypass at all, let alone NOCB. Of course in the long term the goal is to have
bypass working without NOCB but why even bothering implementing it for nocb
in the first place?
Several highlights:
1) NOCB is most often needed for nohz_full and the latter has terrible power
management. The CPU 0 is active all the time there.
2) NOCB without nohz_full has extremely rare usecase (RT niche:
https://lore.kernel.org/lkml/CAFzL-7vqTX-y06Kc3HaLqRWAYE0d=ms3TzVtZLn0c6ATrKD+Qw@mail.gmail.com/
)
2) NOCB implies performance issues.
3) We are mixing up two very different things in a single list of callbacks:
lazy callbacks and flooding callbacks, as a result we are adding lots of
off-topic corner cases all around:
* a seperate lazy len field to struct rcu_cblist whose purpose is much more
general than just bypass/lazy
* "lazy" specialized parameters to general purpose cblist management
functions
4) This is further complexifying bypass core code, nocb timer management, core
nocb group management, all of which being already very complicated.
5) The !NOCB implementation is going to be very different
Ok I can admit one counter argument in favour of using NO_CB:
-1) The scheduler can benefit from a wake CPU to run the callbacks on behalf of a bunch
of idle CPUs, instead of waking up that bunch of CPUs. But still we are dealing
with callbacks that can actually wait...
So here is a proposal: how about forgetting NOCB for now and instead add a new
RCU_LAZY_TAIL segment in the struct rcu_segcblist right after RCU_NEXT_TAIL?
Then ignore that segment until some timer expiry has been met or the CPU is
known to be busy? Probably some tiny bits need to be tweaked in segcblist
management functions but probably not that much. And also make sure that entrain()
queues to RCU_LAZY_TAIL.
Then the only difference in the case of NOCB is that we add a new timer to the
nocb group leader instead of a local timer in !NOCB.
Now of course I'm certainly overlooking obvious things as always :)
Thanks.
next prev parent reply other threads:[~2022-08-29 13:41 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 20:48 [PATCH v4 00/14] Implement call_rcu_lazy() and miscellaneous fixes Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 01/14] rcu: Introduce call_rcu_lazy() API implementation Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 02/14] rcu: shrinker for lazy rcu Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 03/14] rcuscale: Add laziness and kfree tests Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 04/14] fs: Move call_rcu() to call_rcu_lazy() in some paths Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 05/14] rcutorture: Add test code for call_rcu_lazy() Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 06/14] debug: Toggle lazy at runtime and change flush jiffies Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 07/14] cred: Move call_rcu() to call_rcu_lazy() Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 08/14] security: " Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 09/14] net/core: " Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 10/14] kernel: Move various core kernel usages " Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 11/14] lib: Move call_rcu() " Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 12/14] i915: " Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 13/14] fork: Move thread_stack_free_rcu to call_rcu_lazy Joel Fernandes (Google)
2022-08-19 20:48 ` [PATCH v4 14/14] rcu/tree: Move trace_rcu_callback() before bypassing Joel Fernandes (Google)
2022-08-29 13:40 ` Frederic Weisbecker [this message]
2022-08-29 16:45 ` [PATCH v4 00/14] Implement call_rcu_lazy() and miscellaneous fixes Joel Fernandes
2022-08-29 19:46 ` Frederic Weisbecker
2022-08-29 20:31 ` Paul E. McKenney
2022-08-29 20:54 ` Joel Fernandes
2022-08-30 10:50 ` Frederic Weisbecker
2022-08-30 11:47 ` Paul E. McKenney
2022-08-29 20:36 ` Joel Fernandes
2022-08-29 20:42 ` Paul E. McKenney
2022-08-29 20:48 ` Joel Fernandes
2022-08-30 10:57 ` Frederic Weisbecker
2022-08-30 10:53 ` Frederic Weisbecker
2022-08-30 11:43 ` Paul E. McKenney
2022-08-30 16:03 ` Frederic Weisbecker
2022-08-30 16:22 ` Frederic Weisbecker
2022-08-30 16:44 ` Uladzislau Rezki
2022-08-30 18:53 ` Joel Fernandes
2022-09-01 11:29 ` Frederic Weisbecker
2022-09-01 11:59 ` Uladzislau Rezki
2022-09-01 14:41 ` Paul E. McKenney
2022-09-01 15:30 ` Frederic Weisbecker
2022-09-01 16:11 ` Joel Fernandes
2022-09-01 16:52 ` Paul E. McKenney
2022-09-01 15:13 ` Frederic Weisbecker
2022-09-01 16:07 ` Joel Fernandes
2022-08-30 16:46 ` Paul E. McKenney
2022-08-31 15:26 ` Frederic Weisbecker
2022-09-01 14:39 ` Paul E. McKenney
2022-09-01 14:58 ` Frederic Weisbecker
2022-09-01 16:07 ` Joel Fernandes
2022-09-01 16:49 ` Paul E. McKenney
2022-09-01 18:28 ` Frederic Weisbecker
2022-09-01 20:36 ` Paul E. McKenney
2022-08-30 18:46 ` Joel Fernandes
2022-08-30 10:26 ` Frederic Weisbecker
2022-08-30 18:40 ` Joel Fernandes
2022-08-29 19:57 ` Paul E. McKenney
2022-08-30 10:43 ` Frederic Weisbecker
2022-08-30 12:08 ` Paul E. McKenney
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=20220829134045.GA54589@lothringen \
--to=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.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 \
--cc=vineeth@bitbyteword.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