Skip to contentSkip to conversation

Function rcu_dynticks_eqs_exit spent more cycles to processor

DISCUSSION Paul E. McKenney 1 participant 1 message Nov 25, 2018 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · Corcodel Marian

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

Quoted 17 lines

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();
}