lkml.org 
[lkml]   [2016]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] locking/percpu-rwsem: Introduce bias knob
On Thu, Jul 14, 2016 at 08:25:47PM +0200, Peter Zijlstra wrote:
> @@ -19,6 +20,13 @@ int __percpu_init_rwsem(struct percpu_rw
>
> /* ->rw_sem represents the whole percpu_rw_semaphore for lockdep */
> rcu_sync_init(&sem->rss, RCU_SCHED_SYNC);
> + if (bias == PERCPU_RWSEM_WRITER) {
> + /*
> + * Disable rcu_sync() and force slow path.
> + */
> + sem->rss.gp_count++;
> + sem->rss.gp_state = !0;
> + }
> __init_rwsem(&sem->rw_sem, name, rwsem_key);
> init_waitqueue_head(&sem->writer);
> sem->state = readers_slow;

So this seemed like a better deal than calling rcu_sync_enter(), because
that would still incur a (pointless) synchronize_sched() at init time
and people do tend to complain about things like that.

\
 
 \ /
  Last update: 2016-07-14 21:21    [W:0.075 / U:10.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site