Re: question about BIO/request ordering / barriers

From: Jens Axboe (axboe_at_suse.de)
Date: 12/31/03

  • Next message: Matthias Schniedermeyer: "Re: i18n for kernel 2.7.x?"
    Date:	Wed, 31 Dec 2003 16:56:07 +0100
    To: Christophe Saout <christophe@saout.de>
    
    

    On Wed, Dec 31 2003, Christophe Saout wrote:
    > Hi!
    >
    > I'm just digging through the device-mapper code and a question came up:
    >
    > Are "intermediate block device drivers" (like device-mapper) allowed to
    > reorder BIOs?
    >
    > I'm not talking about BIOs submitted from different threads at the same
    > time but BIOs submitted from the same thread sequentially, especially
    > writes.
    >
    > That would mean that BIOs might be reordered around barriers which would
    > break potential users.

    That would not be a good idea. Reordering around a barrier is forbidden,
    you may reorder as you please otherwise. Consider yourself the io
    scheduler, that is essentially the function you are performing. The io
    scheduler will honor the barrier as well.

    > At the moment I suppose this shouldn't be an issue because I didn't find
    > a single user in the whole kernel that actually submits BIOs with
    > BIO_RW_BARRIER set via submit_bio/generic_make_request (journaling
    > filesystems are simply waiting until all writes are finished before
    > continueing, right?).

    Right, there are some missing bits still.

    > There are same cases (in device-mapper) where
    >
    > a) writes get get suspended and queued for later submission where it is
    > not ensured that those writes are submitted before any other writes that
    > could possibly occur after the device gets resumed (generic dm code)
    > b) a stack (instead of a fifo) is used to queue requests and submit them
    > later (not yet included code)
    > c) writes can get queued but reads are directly passed through
    > (snapshotting code too)
    >
    > Also, if DM recevices a barrier shouldn't this barrier be somehow sent
    > to all real devices instead of the one that the request is actually sent
    > to?

    Yes, the driver must take whatever precautions necessary...

    -- 
    Jens Axboe
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Matthias Schniedermeyer: "Re: i18n for kernel 2.7.x?"

    Relevant Pages

    • Re: question about BIO/request ordering / barriers
      ... >> reorder BIOs? ... > you may reorder as you please otherwise. ... > scheduler will honor the barrier as well. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: large install problem with large drive (160gb)
      ... and see if there is any BIOS update which could remove the 137GB barrier. ... Mixing different geometries for two ...
      (comp.unix.bsd.freebsd.misc)
    • Re: Hard drive
      ... I'm writing today to find out how to increase the size of my new ... You might want to look to see if the controller or BIOS of your system can ... The 32GB that is being reported is a known barrier for ... Search google for "32GB hard drive limit". ...
      (alt.os.linux.redhat)