mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] blk-mq: handle dma_drain_size
Date: Tue, 11 Feb 2014 08:26:30 -0800	[thread overview]
Message-ID: <20140211162704.842299822@bombadil.infradead.org> (raw)
In-Reply-To: <20140211162627.319192015@bombadil.infradead.org>

[-- Attachment #1: 0003-blk-mq-handle-dma_drain_size.patch --]
[-- Type: text/plain, Size: 876 bytes --]

Make blk-mq handle the dma_drain_size field the same way as the old request
path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 40fc4dd..35800e1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -561,6 +561,16 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
 		list_del_init(&rq->queuelist);
 		blk_mq_start_request(rq);
 
+		if (q->dma_drain_size && blk_rq_bytes(rq)) {
+			/*
+			 * make sure space for the drain appears we
+			 * know we can do this because max_hw_segments
+			 * has been adjusted to be one fewer than the
+			 * device can handle
+			 */
+			rq->nr_phys_segments++;
+		}
+
 		/*
 		 * Last request in the series. Flag it as such, this
 		 * enables drivers to know when IO should be kicked off,
-- 
1.7.10.4



  parent reply	other threads:[~2014-02-11 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 16:26 [PATCH 0/4] blk-mq ->queue_rq error return fixes Christoph Hellwig
2014-02-11 16:26 ` [PATCH 1/4] blk-mq: support at_head inserations for blk_execute_rq Christoph Hellwig
2014-02-11 16:26 ` [PATCH 2/4] blk-mq: divert __blk_put_request for MQ ops Christoph Hellwig
2014-02-11 16:26 ` Christoph Hellwig [this message]
2014-02-11 16:26 ` [PATCH 4/4] blk-mq: initialize sg_reserved_size Christoph Hellwig
2014-02-11 16:28 ` [PATCH 0/4] blk-mq ->queue_rq error return fixes Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07 18:22 [PATCH 0/4] minor blk-mq updates Christoph Hellwig
2014-02-07 18:22 ` [PATCH 3/4] blk-mq: handle dma_drain_size Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140211162704.842299822@bombadil.infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®