Jack Steiner wrote: >On Sat, May 01, 2004 at 02:17:04PM -0700, William Lee Irwin III wrote: >> On Sat, May 01, 2004 at 07:08:05AM -0500, Jack Steiner wrote: >> > On a 512p idle 2.6.5 system, each cpu spends ~6% of the time in the kernel >> > RCU code. The time is spent contending for shared cache lines. >> >> Would something like this help cacheline contention? This uses the >> per_cpu data areas to hold per-cpu booleans for needing switches. >> Untested/uncompiled. > > > [snip] > >We use 64MB granules. The percpu data structures on the individual nodes >are separated by addresses that differ by many GB. A scan of all percpu >data structures requires a TLB entry for each node. This is costly & >trashes the TLB. (Our max system size is currently 256 nodes). > > rcu_cpu_mask serves two purposes: - if a bit for a cpu is set, then the cpu must report quiescent states. Thus all cpus continuously poll their own bits. - If a cpu notices that it completed a quiescent state, it clears it's own bit, checks all bits and completes the grace period. This happens under a global spinlock. What about splitting that into two variables? A global counter could be used to inform the cpus that they should look for quiescent states. The cacheline would be mostly read-only, it shouldn't cause trashing. Attached is a patch - it boots uniprocessor i386. What do you think? It should remove the hotspot from scheduler_tick entirely. -- Manfred