• Bart Van Assche's avatar
    block: Make blk_get_request() block for non-PM requests while suspended · 7cedffec
    Bart Van Assche authored
    Instead of allowing requests that are not power management requests
    to enter the queue in runtime suspended status (RPM_SUSPENDED), make
    the blk_get_request() caller block. This change fixes a starvation
    issue: it is now guaranteed that power management requests will be
    executed no matter how many blk_get_request() callers are waiting.
    For blk-mq, instead of maintaining the q->nr_pending counter, rely
    on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a
    request finishes instead of only if the queue depth drops to zero.
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
    Cc: Hannes Reinecke <hare@suse.com>
    Cc: Johannes Thumshirn <jthumshirn@suse.de>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    7cedffec
blk-core.c 98.8 KB