Commit b5742733 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] don't hold mapping->private_lock while marking a page dirty

__set_page_dirty_buffers() is calling __mark_inode_dirty under
mapping->private_lock.

We don't need to hold ->private_lock across that call.  It's only there
to pin page->buffers.

This simplifies the VM locking heirarchy.
parent c8b254cc
...@@ -493,7 +493,6 @@ int __set_page_dirty_buffers(struct page *page) ...@@ -493,7 +493,6 @@ int __set_page_dirty_buffers(struct page *page)
buffer_error(); buffer_error();
spin_lock(&mapping->private_lock); spin_lock(&mapping->private_lock);
if (page_has_buffers(page)) { if (page_has_buffers(page)) {
struct buffer_head *head = page_buffers(page); struct buffer_head *head = page_buffers(page);
struct buffer_head *bh = head; struct buffer_head *bh = head;
...@@ -506,6 +505,7 @@ int __set_page_dirty_buffers(struct page *page) ...@@ -506,6 +505,7 @@ int __set_page_dirty_buffers(struct page *page)
bh = bh->b_this_page; bh = bh->b_this_page;
} while (bh != head); } while (bh != head);
} }
spin_unlock(&mapping->private_lock);
if (!TestSetPageDirty(page)) { if (!TestSetPageDirty(page)) {
write_lock(&mapping->page_lock); write_lock(&mapping->page_lock);
...@@ -519,7 +519,6 @@ int __set_page_dirty_buffers(struct page *page) ...@@ -519,7 +519,6 @@ int __set_page_dirty_buffers(struct page *page)
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES); __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
} }
spin_unlock(&mapping->private_lock);
out: out:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment