diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-04-08 21:30:24 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-08 21:30:24 -0700 |
| commit | 8e98702b845d48b79418c2eebf60badcb2ef22c0 (patch) | |
| tree | 56c81f414c5d0f2d2805b2e93a8eba4a8685e10f /fs/mpage.c | |
| parent | df921d4dac2bc2f1fd0d6d461710cefcc7d67769 (diff) | |
[PATCH] Replace the radix-tree rwlock with a spinlock
Spinlocks don't have a buslocked unlock and are faster.
On a P4, time to write a 4M file with 4M one-byte-write()s:
Before:
0.72s user 5.47s system 99% cpu 6.227 total
0.76s user 5.40s system 100% cpu 6.154 total
0.77s user 5.38s system 100% cpu 6.146 total
After:
1.09s user 4.92s system 99% cpu 6.014 total
0.74s user 5.28s system 99% cpu 6.023 total
1.03s user 4.97s system 100% cpu 5.991 total
Diffstat (limited to 'fs/mpage.c')
| -rw-r--r-- | fs/mpage.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/mpage.c b/fs/mpage.c index 45f79b8da045..2c91d7c55e10 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -627,7 +627,7 @@ mpage_writepages(struct address_space *mapping, writepage = mapping->a_ops->writepage; pagevec_init(&pvec, 0); - write_lock(&mapping->page_lock); + spin_lock(&mapping->page_lock); while (!list_empty(&mapping->io_pages) && !done) { struct page *page = list_entry(mapping->io_pages.prev, struct page, list); @@ -647,7 +647,7 @@ mpage_writepages(struct address_space *mapping, list_add(&page->list, &mapping->locked_pages); page_cache_get(page); - write_unlock(&mapping->page_lock); + spin_unlock(&mapping->page_lock); /* * At this point we hold neither mapping->page_lock nor @@ -679,12 +679,12 @@ mpage_writepages(struct address_space *mapping, unlock_page(page); } page_cache_release(page); - write_lock(&mapping->page_lock); + spin_lock(&mapping->page_lock); } /* * Leave any remaining dirty pages on ->io_pages */ - write_unlock(&mapping->page_lock); + spin_unlock(&mapping->page_lock); if (bio) mpage_bio_submit(WRITE, bio); return ret; |
