From: Oleg Nesterov <oleg@redhat.com>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: Eric Dumazet <edumazet@google.com>,
"Paul E. McKenney" <paulmck@linux.ibm.com>,
rcu <rcu@vger.kernel.org>
Subject: Re: Question about cacheline bounching with percpu-rwsem and rcu-sync
Date: Fri, 31 May 2019 15:45:30 +0200 [thread overview]
Message-ID: <20190531134529.GC31323@redhat.com> (raw)
In-Reply-To: <CAEXW_YTzUsT8xCD=vkSR=mT+L7ot7tCESTWYVqNt_3SQeVDUEA@mail.gmail.com>
On 05/31, Joel Fernandes wrote:
>
> 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.
The readers won't modify this memory? read_lock/unlock will only update
the per-cpu counter, ->read_count.
Oleg.
next prev parent reply other threads:[~2019-05-31 13:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 13:10 Question about cacheline bounching with percpu-rwsem and rcu-sync Joel Fernandes
2019-05-31 13:45 ` Oleg Nesterov [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190531134529.GC31323@redhat.com \
--to=oleg@redhat.com \
--cc=edumazet@google.com \
--cc=joel@joelfernandes.org \
--cc=paulmck@linux.ibm.com \
--cc=rcu@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.