From: Nick Piggin Date: Sat, 26 Jul 2008 02:45:28 +0000 (-0700) Subject: mm: readahead scan lockless X-Git-Tag: v2.6.27-rc1~158 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=30002ed2e41830ec03ec3e577ad83ac6b188f96e;p=linux-2.6-omap-h63xx.git 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 Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Hugh Dickins Cc: "Paul E. McKenney" Reviewed-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, if (hit_readahead_marker) { pgoff_t start; - read_lock_irq(&mapping->tree_lock); - start = radix_tree_next_hole(&mapping->page_tree, offset, max+1); - read_unlock_irq(&mapping->tree_lock); + rcu_read_lock(); + start = radix_tree_next_hole(&mapping->page_tree, offset,max+1); + rcu_read_unlock(); if (!start || start - offset > max) return 0;