diff options
author | Chen, Kenneth W <kenneth.w.chen@intel.com> | 2006-12-13 03:34:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:50 -0500 |
commit | e61c90188b9956edae1105eef361d8981a352fcd (patch) | |
tree | 7de9cc41910c55e32aba0f8cc07f73923b7cb515 /include | |
parent | 7e913c53609d5e8374f55d6f29c0bcd6650a2362 (diff) |
[PATCH] optimize o_direct on block devices
Implement block device specific .direct_IO method instead of going through
generic direct_io_worker for block device.
direct_io_worker() is fairly complex because it needs to handle O_DIRECT on
file system, where it needs to perform block allocation, hole detection,
extents file on write, and tons of other corner cases. The end result is
that it takes tons of CPU time to submit an I/O.
For block device, the block allocation is much simpler and a tight triple
loop can be written to iterate each iovec and each page within the iovec in
order to construct/prepare bio structure and then subsequently submit it to
the block layer. This significantly speeds up O_D on block device.
[akpm@osdl.org: small speedup]
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/aio.h | 1 | ||||
-rw-r--r-- | include/linux/bio.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h index 3372ec6bf53a..a30ef13c9e62 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -105,6 +105,7 @@ struct kiocb { | |||
105 | wait_queue_t ki_wait; | 105 | wait_queue_t ki_wait; |
106 | loff_t ki_pos; | 106 | loff_t ki_pos; |
107 | 107 | ||
108 | atomic_t ki_bio_count; /* num bio used for this iocb */ | ||
108 | void *private; | 109 | void *private; |
109 | /* State that we remember to be able to restart/retry */ | 110 | /* State that we remember to be able to restart/retry */ |
110 | unsigned short ki_opcode; | 111 | unsigned short ki_opcode; |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 092dbd0e7658..08daf3272c02 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -309,6 +309,7 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | |||
309 | gfp_t); | 309 | gfp_t); |
310 | extern void bio_set_pages_dirty(struct bio *bio); | 310 | extern void bio_set_pages_dirty(struct bio *bio); |
311 | extern void bio_check_pages_dirty(struct bio *bio); | 311 | extern void bio_check_pages_dirty(struct bio *bio); |
312 | extern void bio_release_pages(struct bio *bio); | ||
312 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 313 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); |
313 | extern int bio_uncopy_user(struct bio *); | 314 | extern int bio_uncopy_user(struct bio *); |
314 | void zero_fill_bio(struct bio *bio); | 315 | void zero_fill_bio(struct bio *bio); |