From e61c90188b9956edae1105eef361d8981a352fcd Mon Sep 17 00:00:00 2001 From: "Chen, Kenneth W" Date: Wed, 13 Dec 2006 00:34:36 -0800 Subject: [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 Cc: Christoph Hellwig Cc: Zach Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/bio.c') diff --git a/fs/bio.c b/fs/bio.c index 7ec737eda72b..7618bcb18368 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -916,7 +916,7 @@ void bio_set_pages_dirty(struct bio *bio) } } -static void bio_release_pages(struct bio *bio) +void bio_release_pages(struct bio *bio) { struct bio_vec *bvec = bio->bi_io_vec; int i; -- cgit v1.2.3