diff options
author | Nick Piggin <npiggin@suse.de> | 2008-07-25 22:45:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:06 -0400 |
commit | 19fd6231279be3c3bdd02ed99f9b0eb195978064 (patch) | |
tree | ee09121054262d73c551b57114acd855b82a7a82 /mm/vmscan.c | |
parent | a60637c85893e7191faaafa6a72e197c24386727 (diff) |
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 <npiggin@suse.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 0075eac1cd04..8f71761bc4b7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -399,7 +399,7 @@ static int __remove_mapping(struct address_space *mapping, struct page *page) | |||
399 | BUG_ON(!PageLocked(page)); | 399 | BUG_ON(!PageLocked(page)); |
400 | BUG_ON(mapping != page_mapping(page)); | 400 | BUG_ON(mapping != page_mapping(page)); |
401 | 401 | ||
402 | write_lock_irq(&mapping->tree_lock); | 402 | spin_lock_irq(&mapping->tree_lock); |
403 | /* | 403 | /* |
404 | * The non racy check for a busy page. | 404 | * The non racy check for a busy page. |
405 | * | 405 | * |
@@ -436,17 +436,17 @@ static int __remove_mapping(struct address_space *mapping, struct page *page) | |||
436 | if (PageSwapCache(page)) { | 436 | if (PageSwapCache(page)) { |
437 | swp_entry_t swap = { .val = page_private(page) }; | 437 | swp_entry_t swap = { .val = page_private(page) }; |
438 | __delete_from_swap_cache(page); | 438 | __delete_from_swap_cache(page); |
439 | write_unlock_irq(&mapping->tree_lock); | 439 | spin_unlock_irq(&mapping->tree_lock); |
440 | swap_free(swap); | 440 | swap_free(swap); |
441 | } else { | 441 | } else { |
442 | __remove_from_page_cache(page); | 442 | __remove_from_page_cache(page); |
443 | write_unlock_irq(&mapping->tree_lock); | 443 | spin_unlock_irq(&mapping->tree_lock); |
444 | } | 444 | } |
445 | 445 | ||
446 | return 1; | 446 | return 1; |
447 | 447 | ||
448 | cannot_free: | 448 | cannot_free: |
449 | write_unlock_irq(&mapping->tree_lock); | 449 | spin_unlock_irq(&mapping->tree_lock); |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | 452 | ||