Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1444433
| From | Oleg Nesterov <oleg@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] locking/percpu-rwsem: Optimize readers and reduce global impact |
| Date | 2016-07-15 18:40 +0200 |
| Message-ID | <rVejE-K7-13@gated-at.bofh.it> (permalink) |
| References | <rUTIe-4Mw-13@gated-at.bofh.it> <rUTIe-4Mw-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/14, Peter Zijlstra wrote: > > Currently the percpu-rwsem switches to (global) atomic ops while a > writer is waiting; which could be quite a while and slows down > releasing the readers. > > This patch cures this problem by ordering the reader-state vs > reader-count (see the comments in __percpu_down_read() and > percpu_down_write()). This changes a global atomic op into a full > memory barrier, which doesn't have the global cacheline contention. I've applied this patch + another change you sent on top of it. Everything looks good to me except the __this_cpu_inc() in __percpu_down_read(), > + __down_read(&sem->rw_sem); > + __this_cpu_inc(*sem->read_count); > + __up_read(&sem->rw_sem); Preemption is already enabled, don't we need this_cpu_inc() ? > -EXPORT_SYMBOL_GPL(percpu_up_write); > +EXPORT_SYMBOL(percpu_up_write); and this one ;) I do not really care, but it seems you did this change by accident. Actually, I _think_ we can do some cleanups/improvements on top of this change, but we can do this later. In particular, _perhaps_ we can avoid the unconditional wakeup in __percpu_up_read(), but I am not sure and in any case this needs another change. Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] locking/percpu-rwsem: Optimize readers and reduce global impact Peter Zijlstra <peterz@infradead.org> - 2016-07-14 20:40 +0200
Re: [PATCH 1/2] locking/percpu-rwsem: Optimize readers and reduce global impact Oleg Nesterov <oleg@redhat.com> - 2016-07-15 18:40 +0200
Re: [PATCH 1/2] locking/percpu-rwsem: Optimize readers and reduce global impact Peter Zijlstra <peterz@infradead.org> - 2016-07-15 21:50 +0200
csiph-web