aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-11 16:50:36 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit8b7128429235d9bd72cfd5ed20c77c4f3118f744 (patch)
tree982eda13094af1ccd46e8c3853559a0eb6e298f6 /fs/btrfs/inode.c
parent43e570b08a6c6b1d75f218566a6240542a386fd9 (diff)
Btrfs: Add async worker threads for pre and post IO checksumming
Btrfs has been using workqueues to spread the checksumming load across other CPUs in the system. But, workqueues only schedule work on the same CPU that queued the work, giving them a limited benefit for systems with higher CPU counts. This code adds a generic facility to schedule work with pools of kthreads, and changes the bio submission code to queue bios up. The queueing is important to make sure large numbers of procs on the system don't turn streaming workloads into random workloads by sending IO down concurrently. The end result of all of this is much higher performance (and CPU usage) when doing checksumming on large machines. Two worker pools are created, one for writes and one for endio processing. The two could deadlock if we tried to service both from a single pool. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0f14697becef..7daef8d37006 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -359,7 +359,7 @@ int __btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
359 359
360 kfree(sums); 360 kfree(sums);
361 361
362 return btrfs_map_bio(root, rw, bio, mirror_num); 362 return btrfs_map_bio(root, rw, bio, mirror_num, 1);
363} 363}
364 364
365int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, 365int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
@@ -383,7 +383,7 @@ int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
383 inode, rw, bio, mirror_num, 383 inode, rw, bio, mirror_num,
384 __btrfs_submit_bio_hook); 384 __btrfs_submit_bio_hook);
385mapit: 385mapit:
386 return btrfs_map_bio(root, rw, bio, mirror_num); 386 return btrfs_map_bio(root, rw, bio, mirror_num, 0);
387} 387}
388 388
389int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end) 389int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)