• Andrew Morton's avatar
    [PATCH] per-backing dev unplugging · 6d27f67b
    Andrew Morton authored
    From: Jens Axboe <axboe@suse.de>,
          Chris Mason,
          me, others.
    
    The global unplug list causes horrid spinlock contention on many-disk
    many-CPU setups - throughput is worse than halved.
    
    The other problem with the global unplugging is of course that it will cause
    the unplugging of queues which are unrelated to the I/O upon which the caller
    is about to wait.
    
    So what we do to solve these problems is to remove the global unplug and set
    up the infrastructure under which the VFS can tell the block layer to unplug
    only those queues which are relevant to the page or buffer_head whcih is
    about to be waited upon.
    
    We do this via the very appropriate address_space->backing_dev_info structure.
    
    Most of the complexity is in devicemapper, MD and swapper_space, because for
    these backing devices, multiple queues may need to be unplugged to complete a
    page/buffer I/O.  In each case we ensure that data structures are in place to
    permit us to identify all the lower-level queues which contribute to the
    higher-level backing_dev_info.  Each contributing queue is told to unplug in
    response to a higher-level unplug.
    
    To simplify things in various places we also introduce the concept of a
    "synchronous BIO": it is tagged with BIO_RW_SYNC.  The block layer will
    perform an immediate unplug when it sees one of these go past.
    6d27f67b
fs.h 54.2 KB