diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-09-08 17:13:02 -0400 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-09-08 17:13:02 -0400 |
commit | e604635c8bea16f6177e6133eb3efbfb4a029ef6 (patch) | |
tree | d0d7237d58ee4200123701c61ffb35a88872c04c | |
parent | a01ac532b519dc0e0b4d8bc4e12373e4e4cd1b1a (diff) |
NTFS: Improve scalability by changing the driver global spin lock in
fs/ntfs/aops.c::ntfs_end_buffer_async_read() to a bit spin lock
in the first buffer head of a page.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
-rw-r--r-- | fs/ntfs/ChangeLog | 3 | ||||
-rw-r--r-- | fs/ntfs/aops.c | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 029f856c56c0..32a4150ebcb2 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -86,6 +86,9 @@ ToDo/Notes: | |||
86 | - Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the case | 86 | - Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the case |
87 | where a concurrent truncate has truncated the runlist under our feet. | 87 | where a concurrent truncate has truncated the runlist under our feet. |
88 | - Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c. | 88 | - Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c. |
89 | - In fs/ntfs/aops.c::ntfs_end_buffer_async_read(), use a bit spin lock | ||
90 | in the first buffer head instead of a driver global spin lock to | ||
91 | improve scalability. | ||
89 | 92 | ||
90 | 2.1.23 - Implement extension of resident files and make writing safe as well as | 93 | 2.1.23 - Implement extension of resident files and make writing safe as well as |
91 | many bug fixes, cleanups, and enhancements... | 94 | many bug fixes, cleanups, and enhancements... |
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 52e1aff98b00..950b686f02d3 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -55,9 +55,8 @@ | |||
55 | */ | 55 | */ |
56 | static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | 56 | static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) |
57 | { | 57 | { |
58 | static DEFINE_SPINLOCK(page_uptodate_lock); | ||
59 | unsigned long flags; | 58 | unsigned long flags; |
60 | struct buffer_head *tmp; | 59 | struct buffer_head *first, *tmp; |
61 | struct page *page; | 60 | struct page *page; |
62 | ntfs_inode *ni; | 61 | ntfs_inode *ni; |
63 | int page_uptodate = 1; | 62 | int page_uptodate = 1; |
@@ -89,11 +88,13 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
89 | } | 88 | } |
90 | } else { | 89 | } else { |
91 | clear_buffer_uptodate(bh); | 90 | clear_buffer_uptodate(bh); |
91 | SetPageError(page); | ||
92 | ntfs_error(ni->vol->sb, "Buffer I/O error, logical block %llu.", | 92 | ntfs_error(ni->vol->sb, "Buffer I/O error, logical block %llu.", |
93 | (unsigned long long)bh->b_blocknr); | 93 | (unsigned long long)bh->b_blocknr); |
94 | SetPageError(page); | ||
95 | } | 94 | } |
96 | spin_lock_irqsave(&page_uptodate_lock, flags); | 95 | first = page_buffers(page); |
96 | local_irq_save(flags); | ||
97 | bit_spin_lock(BH_Uptodate_Lock, &first->b_state); | ||
97 | clear_buffer_async_read(bh); | 98 | clear_buffer_async_read(bh); |
98 | unlock_buffer(bh); | 99 | unlock_buffer(bh); |
99 | tmp = bh; | 100 | tmp = bh; |
@@ -108,7 +109,8 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
108 | } | 109 | } |
109 | tmp = tmp->b_this_page; | 110 | tmp = tmp->b_this_page; |
110 | } while (tmp != bh); | 111 | } while (tmp != bh); |
111 | spin_unlock_irqrestore(&page_uptodate_lock, flags); | 112 | bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); |
113 | local_irq_restore(flags); | ||
112 | /* | 114 | /* |
113 | * If none of the buffers had errors then we can set the page uptodate, | 115 | * If none of the buffers had errors then we can set the page uptodate, |
114 | * but we first have to perform the post read mst fixups, if the | 116 | * but we first have to perform the post read mst fixups, if the |
@@ -141,7 +143,8 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
141 | unlock_page(page); | 143 | unlock_page(page); |
142 | return; | 144 | return; |
143 | still_busy: | 145 | still_busy: |
144 | spin_unlock_irqrestore(&page_uptodate_lock, flags); | 146 | bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); |
147 | local_irq_restore(flags); | ||
145 | return; | 148 | return; |
146 | } | 149 | } |
147 | 150 | ||