• Andrew Morton's avatar
    [PATCH] direct-to-BIO for O_DIRECT · 42ec8bc1
    Andrew Morton authored
    Here's a patch which converts O_DIRECT to go direct-to-BIO, bypassing
    the kiovec layer.  It's followed by a patch which converts the raw
    driver to use the O_DIRECT engine.
    
    CPU utilisation is about the same as the kiovec-based implementation.
    Read and write bandwidth are the same too, for 128k chunks.   But with
    one megabyte chunks, this implementation is 20% faster at writing.
    
    I assume this is because the kiobuf-based implementation has to stop
    and wait for each 128k chunk, whereas this code streams the entire
    request, regardless of its size.
    
    This is with a single (oldish) scsi disk on aic7xxx.  I'd expect the
    margin to widen on higher-end hardware which likes to have more
    requests in flight.
    
    Question is: what do we want to do with this sucker?  These are the
    remaining users of kiovecs:
    
    	drivers/md/lvm-snap.c
    	drivers/media/video/video-buf.c
    	drivers/mtd/devices/blkmtd.c
    	drivers/scsi/sg.c
    
    the video and mtd drivers seems to be fairly easy to de-kiobufize.
    I'm aware of one proprietary driver which uses kiobufs.  XFS uses
    kiobufs a little bit - just to map the pages.
    
    So with a bit of effort and maintainer-irritation, we can extract
    the kiobuf layer from the kernel.
    42ec8bc1
block_dev.c 17 KB