07 Oct, 2015
5 commits
-
Based on Peter Zijlstra's earlier patch.
Change percpu_down_read() to use __down_read(), this way we can
do rwsem_acquire_read() unconditionally at the start to make this
code more symmetric and clean.Originally-From: Peter Zijlstra
Signed-off-by: Oleg Nesterov
Signed-off-by: Paul E. McKenney
Reviewed-by: Josh Triplett -
Update the comments broken by the previous change.
Signed-off-by: Oleg Nesterov
Signed-off-by: Paul E. McKenney
Reviewed-by: Josh Triplett -
Currently down_write/up_write calls synchronize_sched_expedited()
twice, which is evil. Change this code to rely on rcu-sync primitives.
This avoids the _expedited "big hammer", and this can be faster in
the contended case or even in the case when a single thread does
down_write/up_write in a loop.Of course, a single down_write() will take more time, but otoh it
will be much more friendly to the whole system.To simplify the review this patch doesn't update the comments, fixed
by the next change.Signed-off-by: Oleg Nesterov
Signed-off-by: Paul E. McKenney
Reviewed-by: Josh Triplett -
This is the temporary ugly hack which will be reverted later. We only
need it to ensure that the next patch will not break "change sb_writers
to use percpu_rw_semaphore" patches routed via the VFS tree.The alloc_super()->destroy_super() error path assumes that it is safe
to call percpu_free_rwsem() after kzalloc() without percpu_init_rwsem(),
so let's not disappoint it.Signed-off-by: Oleg Nesterov
Signed-off-by: Paul E. McKenney
Reviewed-by: Josh Triplett -
This commit exports percpu_down_read(), percpu_down_write(),
__percpu_init_rwsem(), percpu_up_read(), and percpu_up_write() to allow
locktorture to test them when built as a module.Signed-off-by: Paul E. McKenney
Reviewed-by: Josh Triplett
15 Aug, 2015
1 commit
-
Add percpu_down_read_trylock(), it will have the user soon.
Signed-off-by: Oleg Nesterov
06 Nov, 2013
1 commit
-
Suggested-by: Ingo Molnar
Signed-off-by: Peter Zijlstra
Link: http://lkml.kernel.org/n/tip-52bjmtty46we26hbfd9sc9iy@git.kernel.org
Signed-off-by: Ingo Molnar