All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about cacheline bounching with percpu-rwsem and rcu-sync
@ 2019-05-31 13:10 Joel Fernandes
  2019-05-31 13:45 ` Oleg Nesterov
  2019-05-31 13:50 ` Paul E. McKenney
  0 siblings, 2 replies; 8+ messages in thread
From: Joel Fernandes @ 2019-05-31 13:10 UTC (permalink / raw)
  To: Oleg Nesterov, Eric Dumazet, Paul E. McKenney; +Cc: rcu

Hi,
As per the documentation for rationale of percpu-rwsem, the Documentation says:

The problem with traditional read-write semaphores is that when multiple
cores take the lock for reading, the cache line containing the semaphore
is bouncing between L1 caches of the cores, causing performance
degradation.

However, it appears to me that the struct percpu_rwsem "rss" element
which is used by the RCU-sync is not a per-cpu element. So even in the
fastpath case (only readers and no writers), the cacheline containing
rss is shared and will bounce by multiple CPUs. For that matter, even
the cacheline containing the percpu_rw_semaphore itself will be bounce
among multiple reader CPUs.

So how does percpu-rwsem eliminate cache line bouncing in the common
case. Could you let me know what I am missing?

Thanks a lot.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-09 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-31 13:10 Question about cacheline bounching with percpu-rwsem and rcu-sync Joel Fernandes
2019-05-31 13:45 ` Oleg Nesterov
2019-05-31 14:42   ` Joel Fernandes
2019-05-31 13:50 ` Paul E. McKenney
2019-05-31 14:43   ` Joel Fernandes
2019-06-09  0:24     ` Joel Fernandes
2019-06-09 12:22       ` Paul E. McKenney
2019-06-09 21:25         ` Joel Fernandes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.