• C
    [PATCH] optimize o_direct on block devices · e61c9018
    Chen, Kenneth W 提交于
    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: NKen Chen <kenneth.w.chen@intel.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Zach Brown <zach.brown@oracle.com>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    e61c9018
bio.c 29.7 KB