mm: remove useless rcu lock-unlock from mapping_tagged()
Subsystems (2)
PATCH 1/1 mm: remove useless rcu lock-unlock from mapping_tagged()
radix_tree_tagged() is lockless, it does not require any protection.
Signed-off-by Konstantin Khlebnikov <[email protected]>
--- mm/page-writeback.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
mm/page-writeback.c +1 -5
@@ -1405,10 +1405,6 @@ EXPORT_SYMBOL(test_set_page_writeback);*/ int mapping_tagged (struct address_space *mapping,int tag) { -int ret; -rcu_read_lock (); - ret =radix_tree_tagged (&mapping->page_tree, tag); -rcu_read_unlock (); -return ret; +return radix_tree_tagged (&mapping->page_tree, tag); }EXPORT_SYMBOL (mapping_tagged);
Quoted 1 line · Konstantin Khlebnikov
radix_tree_tagged()is lockless, it does not require any protection.
Indeed. The radix_tree_root structure is a field in the address_space structure, so no protection is required to get at the field. If protection is required on the mapping pointer itself, that would have to happen in writeback_single_inode() and friends.
Acked-by Paul E. McKenney <[email protected]>
Quoted 27 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- mm/page-writeback.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)mm/page-writeback.c +1
-6@@ -1405,10 +1405,6 @@ EXPORT_SYMBOL(test_set_page_writeback);*/ int mapping_tagged (struct address_space *mapping,int tag) { -int ret; -rcu_read_lock (); - ret =radix_tree_tagged (&mapping->page_tree, tag); -rcu_read_unlock (); -return ret; +return radix_tree_tagged (&mapping->page_tree, tag); }EXPORT_SYMBOL (mapping_tagged); --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/