mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: use lockless radix-tree probe
Probing pages and radix_tree_tagged are lockless operations with the lockless radix-tree. Convert these users to RCU locking rather than using tree_lock. Signed-off-by: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
557ed1fa26
commit
0012818810
2 changed files with 5 additions and 9 deletions
|
|
@ -1022,17 +1022,15 @@ int test_set_page_writeback(struct page *page)
|
|||
EXPORT_SYMBOL(test_set_page_writeback);
|
||||
|
||||
/*
|
||||
* Return true if any of the pages in the mapping are marged with the
|
||||
* Return true if any of the pages in the mapping are marked with the
|
||||
* passed tag.
|
||||
*/
|
||||
int mapping_tagged(struct address_space *mapping, int tag)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
read_lock_irqsave(&mapping->tree_lock, flags);
|
||||
rcu_read_lock();
|
||||
ret = radix_tree_tagged(&mapping->page_tree, tag);
|
||||
read_unlock_irqrestore(&mapping->tree_lock, flags);
|
||||
rcu_read_unlock();
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(mapping_tagged);
|
||||
|
|
|
|||
Loading…
Reference in a new issue