Skip to content

Commit 30002ed

Browse files
Nick Piggintorvalds
authored andcommitted
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 <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Reviewed-by: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 652ea69 commit 30002ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/readahead.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ ondemand_readahead(struct address_space *mapping,
382382
if (hit_readahead_marker) {
383383
pgoff_t start;
384384

385-
read_lock_irq(&mapping->tree_lock);
386-
start = radix_tree_next_hole(&mapping->page_tree, offset, max+1);
387-
read_unlock_irq(&mapping->tree_lock);
385+
rcu_read_lock();
386+
start = radix_tree_next_hole(&mapping->page_tree, offset,max+1);
387+
rcu_read_unlock();
388388

389389
if (!start || start - offset > max)
390390
return 0;

0 commit comments

Comments
 (0)