mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm: spinlock tree_lock
mapping->tree_lock has no read lockers. convert the lock from an rwlock to a spinlock. 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]>
This commit is contained in:
parent
a60637c858
commit
19fd623127
12 changed files with 38 additions and 39 deletions
11
mm/migrate.c
11
mm/migrate.c
|
|
@ -323,7 +323,7 @@ static int migrate_page_move_mapping(struct address_space *mapping,
|
|||
return 0;
|
||||
}
|
||||
|
||||
write_lock_irq(&mapping->tree_lock);
|
||||
spin_lock_irq(&mapping->tree_lock);
|
||||
|
||||
pslot = radix_tree_lookup_slot(&mapping->page_tree,
|
||||
page_index(page));
|
||||
|
|
@ -331,12 +331,12 @@ static int migrate_page_move_mapping(struct address_space *mapping,
|
|||
expected_count = 2 + !!PagePrivate(page);
|
||||
if (page_count(page) != expected_count ||
|
||||
(struct page *)radix_tree_deref_slot(pslot) != page) {
|
||||
write_unlock_irq(&mapping->tree_lock);
|
||||
spin_unlock_irq(&mapping->tree_lock);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (!page_freeze_refs(page, expected_count)) {
|
||||
write_unlock_irq(&mapping->tree_lock);
|
||||
spin_unlock_irq(&mapping->tree_lock);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
|
|
@ -373,10 +373,9 @@ static int migrate_page_move_mapping(struct address_space *mapping,
|
|||
__dec_zone_page_state(page, NR_FILE_PAGES);
|
||||
__inc_zone_page_state(newpage, NR_FILE_PAGES);
|
||||
|
||||
write_unlock_irq(&mapping->tree_lock);
|
||||
if (!PageSwapCache(newpage)) {
|
||||
spin_unlock_irq(&mapping->tree_lock);
|
||||
if (!PageSwapCache(newpage))
|
||||
mem_cgroup_uncharge_cache_page(page);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue