aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 3ca6392e82cc..153572fb60b8 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -323,7 +323,7 @@ static int migrate_page_move_mapping(struct address_space *mapping,
323 return 0; 323 return 0;
324 } 324 }
325 325
326 write_lock_irq(&mapping->tree_lock); 326 spin_lock_irq(&mapping->tree_lock);
327 327
328 pslot = radix_tree_lookup_slot(&mapping->page_tree, 328 pslot = radix_tree_lookup_slot(&mapping->page_tree,
329 page_index(page)); 329 page_index(page));
@@ -331,12 +331,12 @@ static int migrate_page_move_mapping(struct address_space *mapping,
331 expected_count = 2 + !!PagePrivate(page); 331 expected_count = 2 + !!PagePrivate(page);
332 if (page_count(page) != expected_count || 332 if (page_count(page) != expected_count ||
333 (struct page *)radix_tree_deref_slot(pslot) != page) { 333 (struct page *)radix_tree_deref_slot(pslot) != page) {
334 write_unlock_irq(&mapping->tree_lock); 334 spin_unlock_irq(&mapping->tree_lock);
335 return -EAGAIN; 335 return -EAGAIN;
336 } 336 }
337 337
338 if (!page_freeze_refs(page, expected_count)) { 338 if (!page_freeze_refs(page, expected_count)) {
339 write_unlock_irq(&mapping->tree_lock); 339 spin_unlock_irq(&mapping->tree_lock);
340 return -EAGAIN; 340 return -EAGAIN;
341 } 341 }
342 342
@@ -373,10 +373,9 @@ static int migrate_page_move_mapping(struct address_space *mapping,
373 __dec_zone_page_state(page, NR_FILE_PAGES); 373 __dec_zone_page_state(page, NR_FILE_PAGES);
374 __inc_zone_page_state(newpage, NR_FILE_PAGES); 374 __inc_zone_page_state(newpage, NR_FILE_PAGES);
375 375
376 write_unlock_irq(&mapping->tree_lock); 376 spin_unlock_irq(&mapping->tree_lock);
377 if (!PageSwapCache(newpage)) { 377 if (!PageSwapCache(newpage))
378 mem_cgroup_uncharge_cache_page(page); 378 mem_cgroup_uncharge_cache_page(page);
379 }
380 379
381 return 0; 380 return 0;
382} 381}