On 1/23/2026 4:27 PM, Paul E. McKenney wrote:
On Fri, Jan 23, 2026 at 02:36:37PM -0500, Joel Fernandes wrote:
On 1/23/2026 11:49 AM, Paul E. McKenney wrote:
We could have one CPU flooding and the rest idle, and many other
combinations. And, if I recall correctly, polling can burn extra CPU
and cause extra wakeups even when the system is fully idle. Or has
that changed?
In my experience working on lazy RCU, if you have such a kind of overload on
any CPU, then you're usually not saving any power anyway. The system has to
be really quiet and idle with a low stream of callbacks for you to save
power. Further, when the callback length increases too much, we don't turn
on lazy RCU anyway because the idea is that we are overloaded and the
system is busy - so we already have such assumptions baked in. I think a
similar argument could apply here for dynamically enabling polling mode only
when overloaded.
The concern is detecting overload quickly. Any unnecessary gaps in
invoking RCU callbacks cannot be made up. That time is gone.
And the polling does sleeps...
Right, the time is gone, but perhaps the recent past is an indication
that the gears of the machinery need to move faster, possibly to improve
things. :-D. Obviously, it's also totally possible that entering polling
mode doesn't benefit anything if RCU readers are taking forever to exit
their critical sections and so forth.
I was coming more from the point of view of improving grace period performance
when we do have an overload, potentially resolving the overloaded situation
faster than usual. We would dynamically trigger polling based on such
circumstances.
That said, I confess I don't have extensive experience with polling mode beyond
testing. I believe we should add more rcutorture test cases for this. I'm
considering adding a new config that enables polling for NOCB - this testing is
what revealed the potential for grace period performance improvement with NOCB
to me.
The main purpose of polling was to make call_rcu() avoid at least some
of its slowpaths. If we are getting some other benefit out of it, is
polling the best way to achieve that benefit?
Thanks for the clarification. I will study what exactly is the behavior
first. The main benefit I see is that Grace Periods progress more
quickly in polling mode. My suspicion is perhaps this is because of the
speed of wakeups happening due to timer interrupts vs. those happening
because of one thread waking another. I am just speculating, and I will
study it more before being able to say anything meaningful here. ;-).
But thanks for the discussion!
--
Joel Fernandes