• Jens Axboe's avatar
    [PATCH] block plugging reworked · eba5b46c
    Jens Axboe authored
    This patch provides the ability for a block driver to signal it's too
    busy to receive more work and temporarily halt the request queue. In
    concept it's similar to the networking netif_{start,stop}_queue helpers.
    
    To do this cleanly, I've ripped out the old tq_disk task queue. Instead
    an internal list of plugged queues is maintained which will honor the
    current queue state (see QUEUE_FLAG_STOPPED bit). Execution of
    request_fn has been moved to tasklet context. blk_run_queues() provides
    similar functionality to the old run_task_queue(&tq_disk).
    
    Now, this only works at the request_fn level and not at the
    make_request_fn level. This is on purpose: drivers working at the
    make_request_fn level are essentially providing a piece of the block
    level infrastructure themselves. There are basically two reasons for
    doing make_request_fn style setups:
    
    o block remappers. start/stop functionality will be done at the target
      device in this case, which is the level that will signal hardware full
      (or continue) anyways.
    
    o drivers who wish to receive single entities of "buffers" and not
      merged requests etc. This could use the start/stop functionality. I'd
      suggest _still_ using a request_fn for these, but set the queue
      options so that no merging etc ever takes place. This has the added
      bonus of providing the usual request depletion throttling at the block
      level.
    eba5b46c
ll_rw_blk.c 50 KB