Re: Function rcu_dynticks_eqs_exit spent more cycles to processor

From: Paul E. McKenney
Date: Sun Nov 25 2018 - 17:35:30 EST


On Sun, Nov 25, 2018 at 09:41:26PM +0200, Corcodel Marian wrote:
> Hi below , in modified func from kernel/rcu/tree.c and not stall proc,
> run perf for more info.
> Item type atomic_t dynticks from rcu_dynticks stucture can bee replaced
> with u8 type, because Intel guarrantee atomic operations to byte.
> Eg, rtdp->dynticks = ~RCU_DYNTICK_CTRL_MASK;

I am not clear on exactly what change you are suggesting. But regardless,
this is core code, so it must run on all CPUs that the Linux kernel
supports, not just Intel x86. Furthermore, a straight store of
~RCU_DYNTICK_CTRL_MASK would be rather destructive in this function,
if that is what you are getting at with your assignment statement above.
So again, I am not clear on exactly what change you are suggesting, but
whatever it is, it must build and run on all architectures.

Adding LKML on CC, develop in the open and all that.

Thanx, Paul

> static void rcu_dynticks_eqs_exit(void)
> {
> struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
>
> /*
> * CPUs seeing atomic_add_return() must see prior idle
> sojourns,
> * and we also must force ordering with the next RCU read-side
> * critical section.
> */
> atomic_andnot(RCU_DYNTICK_CTRL_MASK, &rdtp->dynticks);
> smp_mb__after_atomic(); /* _exit after clearing mask.
> */
> /* Prefer duplicate flushes to losing a flush. */
> rcu_eqs_special_exit();
> }
>