Commit 30002ed2 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

mm: readahead scan lockless

radix_tree_next_hole() is implemented as a series of radix_tree_lookup()s.
So it can be called locklessly, under rcu_read_lock().
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Reviewed-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 652ea695
...@@ -382,9 +382,9 @@ ondemand_readahead(struct address_space *mapping, ...@@ -382,9 +382,9 @@ ondemand_readahead(struct address_space *mapping,
if (hit_readahead_marker) { if (hit_readahead_marker) {
pgoff_t start; pgoff_t start;
read_lock_irq(&mapping->tree_lock); rcu_read_lock();
start = radix_tree_next_hole(&mapping->page_tree, offset, max+1); start = radix_tree_next_hole(&mapping->page_tree, offset,max+1);
read_unlock_irq(&mapping->tree_lock); rcu_read_unlock();
if (!start || start - offset > max) if (!start || start - offset > max)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment