diff options
author | Nick Piggin <npiggin@suse.de> | 2008-07-25 22:45:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:06 -0400 |
commit | 30002ed2e41830ec03ec3e577ad83ac6b188f96e (patch) | |
tree | 13896f3038e391eb41246455239d7678cf51b011 /mm/readahead.c | |
parent | 652ea695364142b2464744746beac206d050ef19 (diff) |
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: Nick 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: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index d8723a5f649..77e8ddf945e 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -382,9 +382,9 @@ ondemand_readahead(struct address_space *mapping, | |||
382 | if (hit_readahead_marker) { | 382 | if (hit_readahead_marker) { |
383 | pgoff_t start; | 383 | pgoff_t start; |
384 | 384 | ||
385 | read_lock_irq(&mapping->tree_lock); | 385 | rcu_read_lock(); |
386 | start = radix_tree_next_hole(&mapping->page_tree, offset, max+1); | 386 | start = radix_tree_next_hole(&mapping->page_tree, offset,max+1); |
387 | read_unlock_irq(&mapping->tree_lock); | 387 | rcu_read_unlock(); |
388 | 388 | ||
389 | if (!start || start - offset > max) | 389 | if (!start || start - offset > max) |
390 | return 0; | 390 | return 0; |