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>
This commit is contained in:
committed by
Linus Torvalds
parent
a60637c858
commit
19fd623127
@@ -1088,7 +1088,7 @@ int __set_page_dirty_nobuffers(struct page *page)
|
||||
if (!mapping)
|
||||
return 1;
|
||||
|
||||
write_lock_irq(&mapping->tree_lock);
|
||||
spin_lock_irq(&mapping->tree_lock);
|
||||
mapping2 = page_mapping(page);
|
||||
if (mapping2) { /* Race with truncate? */
|
||||
BUG_ON(mapping2 != mapping);
|
||||
@@ -1102,7 +1102,7 @@ int __set_page_dirty_nobuffers(struct page *page)
|
||||
radix_tree_tag_set(&mapping->page_tree,
|
||||
page_index(page), PAGECACHE_TAG_DIRTY);
|
||||
}
|
||||
write_unlock_irq(&mapping->tree_lock);
|
||||
spin_unlock_irq(&mapping->tree_lock);
|
||||
if (mapping->host) {
|
||||
/* !PageAnon && !swapper_space */
|
||||
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
|
||||
@@ -1258,7 +1258,7 @@ int test_clear_page_writeback(struct page *page)
|
||||
struct backing_dev_info *bdi = mapping->backing_dev_info;
|
||||
unsigned long flags;
|
||||
|
||||
write_lock_irqsave(&mapping->tree_lock, flags);
|
||||
spin_lock_irqsave(&mapping->tree_lock, flags);
|
||||
ret = TestClearPageWriteback(page);
|
||||
if (ret) {
|
||||
radix_tree_tag_clear(&mapping->page_tree,
|
||||
@@ -1269,7 +1269,7 @@ int test_clear_page_writeback(struct page *page)
|
||||
__bdi_writeout_inc(bdi);
|
||||
}
|
||||
}
|
||||
write_unlock_irqrestore(&mapping->tree_lock, flags);
|
||||
spin_unlock_irqrestore(&mapping->tree_lock, flags);
|
||||
} else {
|
||||
ret = TestClearPageWriteback(page);
|
||||
}
|
||||
@@ -1287,7 +1287,7 @@ int test_set_page_writeback(struct page *page)
|
||||
struct backing_dev_info *bdi = mapping->backing_dev_info;
|
||||
unsigned long flags;
|
||||
|
||||
write_lock_irqsave(&mapping->tree_lock, flags);
|
||||
spin_lock_irqsave(&mapping->tree_lock, flags);
|
||||
ret = TestSetPageWriteback(page);
|
||||
if (!ret) {
|
||||
radix_tree_tag_set(&mapping->page_tree,
|
||||
@@ -1300,7 +1300,7 @@ int test_set_page_writeback(struct page *page)
|
||||
radix_tree_tag_clear(&mapping->page_tree,
|
||||
page_index(page),
|
||||
PAGECACHE_TAG_DIRTY);
|
||||
write_unlock_irqrestore(&mapping->tree_lock, flags);
|
||||
spin_unlock_irqrestore(&mapping->tree_lock, flags);
|
||||
} else {
|
||||
ret = TestSetPageWriteback(page);
|
||||
}
|
||||
|
Reference in New Issue
Block a user