From: Jens Axboe <axboe@kernel.dk> To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Jens Axboe <axboe@kernel.dk> Subject: [PATCH 13/14] block: add REQ_HIPRI and inherit it from IOCB_HIPRI Date: Thu, 25 Oct 2018 15:16:25 -0600 [thread overview] Message-ID: <20181025211626.12692-14-axboe@kernel.dk> (raw) In-Reply-To: <20181025211626.12692-1-axboe@kernel.dk> We use IOCB_HIPRI to poll for IO in the caller instead of scheduling. This information is not available for (or after) IO submission. The driver may make different queue choices based on the type of IO, so make the fact that we will poll for this IO known to the lower layers as well. Signed-off-by: Jens Axboe <axboe@kernel.dk> --- fs/block_dev.c | 2 ++ fs/direct-io.c | 2 ++ fs/iomap.c | 9 ++++++++- include/linux/blk_types.h | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 38b8ce05cbc7..8bb8090c57a7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -232,6 +232,8 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, bio.bi_opf = dio_bio_write_op(iocb); task_io_account_write(ret); } + if (iocb->ki_flags & IOCB_HIPRI) + bio.bi_opf |= REQ_HIPRI; qc = submit_bio(&bio); for (;;) { diff --git a/fs/direct-io.c b/fs/direct-io.c index 093fb54cd316..ffb46b7aa5f7 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -1265,6 +1265,8 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, } else { dio->op = REQ_OP_READ; } + if (iocb->ki_flags & IOCB_HIPRI) + dio->op_flags |= REQ_HIPRI; /* * For AIO O_(D)SYNC writes we need to defer completions to a workqueue diff --git a/fs/iomap.c b/fs/iomap.c index ec15cf2ec696..50ad8c8d1dcb 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -1554,6 +1554,7 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, unsigned len) { struct page *page = ZERO_PAGE(0); + int flags = REQ_SYNC | REQ_IDLE; struct bio *bio; bio = bio_alloc(GFP_KERNEL, 1); @@ -1562,9 +1563,12 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, bio->bi_private = dio; bio->bi_end_io = iomap_dio_bio_end_io; + if (dio->iocb->ki_flags & IOCB_HIPRI) + flags |= REQ_HIPRI; + get_page(page); __bio_add_page(bio, page, len, 0); - bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC | REQ_IDLE); + bio_set_op_attrs(bio, REQ_OP_WRITE, flags); atomic_inc(&dio->ref); return submit_bio(bio); @@ -1663,6 +1667,9 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, bio_set_pages_dirty(bio); } + if (dio->iocb->ki_flags & IOCB_HIPRI) + bio->bi_opf |= REQ_HIPRI; + iov_iter_advance(dio->submit.iter, n); dio->size += n; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 093a818c5b68..d6c2558d6b73 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -322,6 +322,8 @@ enum req_flag_bits { /* command specific flags for REQ_OP_WRITE_ZEROES: */ __REQ_NOUNMAP, /* do not free blocks when zeroing */ + __REQ_HIPRI, + /* for driver use */ __REQ_DRV, __REQ_SWAP, /* swapping request. */ @@ -342,8 +344,8 @@ enum req_flag_bits { #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) #define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND) #define REQ_NOWAIT (1ULL << __REQ_NOWAIT) - #define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP) +#define REQ_HIPRI (1ULL << __REQ_HIPRI) #define REQ_DRV (1ULL << __REQ_DRV) #define REQ_SWAP (1ULL << __REQ_SWAP) -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: axboe@kernel.dk (Jens Axboe) Subject: [PATCH 13/14] block: add REQ_HIPRI and inherit it from IOCB_HIPRI Date: Thu, 25 Oct 2018 15:16:25 -0600 [thread overview] Message-ID: <20181025211626.12692-14-axboe@kernel.dk> (raw) In-Reply-To: <20181025211626.12692-1-axboe@kernel.dk> We use IOCB_HIPRI to poll for IO in the caller instead of scheduling. This information is not available for (or after) IO submission. The driver may make different queue choices based on the type of IO, so make the fact that we will poll for this IO known to the lower layers as well. Signed-off-by: Jens Axboe <axboe at kernel.dk> --- fs/block_dev.c | 2 ++ fs/direct-io.c | 2 ++ fs/iomap.c | 9 ++++++++- include/linux/blk_types.h | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 38b8ce05cbc7..8bb8090c57a7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -232,6 +232,8 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, bio.bi_opf = dio_bio_write_op(iocb); task_io_account_write(ret); } + if (iocb->ki_flags & IOCB_HIPRI) + bio.bi_opf |= REQ_HIPRI; qc = submit_bio(&bio); for (;;) { diff --git a/fs/direct-io.c b/fs/direct-io.c index 093fb54cd316..ffb46b7aa5f7 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -1265,6 +1265,8 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, } else { dio->op = REQ_OP_READ; } + if (iocb->ki_flags & IOCB_HIPRI) + dio->op_flags |= REQ_HIPRI; /* * For AIO O_(D)SYNC writes we need to defer completions to a workqueue diff --git a/fs/iomap.c b/fs/iomap.c index ec15cf2ec696..50ad8c8d1dcb 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -1554,6 +1554,7 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, unsigned len) { struct page *page = ZERO_PAGE(0); + int flags = REQ_SYNC | REQ_IDLE; struct bio *bio; bio = bio_alloc(GFP_KERNEL, 1); @@ -1562,9 +1563,12 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, bio->bi_private = dio; bio->bi_end_io = iomap_dio_bio_end_io; + if (dio->iocb->ki_flags & IOCB_HIPRI) + flags |= REQ_HIPRI; + get_page(page); __bio_add_page(bio, page, len, 0); - bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC | REQ_IDLE); + bio_set_op_attrs(bio, REQ_OP_WRITE, flags); atomic_inc(&dio->ref); return submit_bio(bio); @@ -1663,6 +1667,9 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, bio_set_pages_dirty(bio); } + if (dio->iocb->ki_flags & IOCB_HIPRI) + bio->bi_opf |= REQ_HIPRI; + iov_iter_advance(dio->submit.iter, n); dio->size += n; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 093a818c5b68..d6c2558d6b73 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -322,6 +322,8 @@ enum req_flag_bits { /* command specific flags for REQ_OP_WRITE_ZEROES: */ __REQ_NOUNMAP, /* do not free blocks when zeroing */ + __REQ_HIPRI, + /* for driver use */ __REQ_DRV, __REQ_SWAP, /* swapping request. */ @@ -342,8 +344,8 @@ enum req_flag_bits { #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) #define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND) #define REQ_NOWAIT (1ULL << __REQ_NOWAIT) - #define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP) +#define REQ_HIPRI (1ULL << __REQ_HIPRI) #define REQ_DRV (1ULL << __REQ_DRV) #define REQ_SWAP (1ULL << __REQ_SWAP) -- 2.17.1
next prev parent reply other threads:[~2018-10-25 21:16 UTC|newest] Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-10-25 21:16 [PATCHSET 0/14] Add support for multiple queue maps Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-25 21:16 ` [PATCH 01/14] blk-mq: kill q->mq_map Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-27 14:19 ` jianchao.wang 2018-10-27 14:19 ` jianchao.wang 2018-10-27 16:48 ` Jens Axboe 2018-10-27 16:48 ` Jens Axboe 2018-10-27 16:52 ` Jens Axboe 2018-10-27 16:52 ` Jens Axboe 2018-10-29 2:02 ` jianchao.wang 2018-10-29 2:02 ` jianchao.wang 2018-10-29 2:40 ` jianchao.wang 2018-10-29 2:40 ` jianchao.wang 2018-10-29 3:00 ` Jens Axboe 2018-10-29 3:00 ` Jens Axboe 2018-10-29 9:03 ` jianchao.wang 2018-10-29 9:03 ` jianchao.wang 2018-10-28 16:10 ` Christoph Hellwig 2018-10-28 16:10 ` Christoph Hellwig 2018-10-29 7:27 ` Hannes Reinecke 2018-10-29 7:27 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 02/14] blk-mq: abstract out queue map Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:30 ` Hannes Reinecke 2018-10-29 7:30 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 03/14] blk-mq: provide dummy blk_mq_map_queue_type() helper Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:30 ` Hannes Reinecke 2018-10-29 7:30 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 04/14] blk-mq: pass in request/bio flags to queue mapping Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:35 ` Hannes Reinecke 2018-10-29 7:35 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 05/14] blk-mq: allow software queue to map to multiple hardware queues Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:37 ` Hannes Reinecke 2018-10-29 7:37 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 06/14] blk-mq: add 'type' attribute to the sysfs hctx directory Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:38 ` Hannes Reinecke 2018-10-29 7:38 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 07/14] blk-mq: support multiple hctx maps Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:39 ` Hannes Reinecke 2018-10-29 7:39 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 08/14] blk-mq: separate number of hardware queues from nr_cpu_ids Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:40 ` Hannes Reinecke 2018-10-29 7:40 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 09/14] blk-mq: ensure that plug lists don't straddle hardware queues Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:40 ` Hannes Reinecke 2018-10-29 7:40 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 10/14] blk-mq: initial support for multiple queue maps Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:41 ` Hannes Reinecke 2018-10-29 7:41 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 11/14] irq: add support for allocating (and affinitizing) sets of IRQs Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-25 21:52 ` Keith Busch 2018-10-25 21:52 ` Keith Busch 2018-10-25 23:07 ` Jens Axboe 2018-10-25 23:07 ` Jens Axboe 2018-10-29 7:43 ` Hannes Reinecke 2018-10-29 7:43 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 12/14] nvme: utilize two queue maps, one for reads and one for writes Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:46 ` Hannes Reinecke 2018-10-29 7:46 ` Hannes Reinecke 2018-10-25 21:16 ` Jens Axboe [this message] 2018-10-25 21:16 ` [PATCH 13/14] block: add REQ_HIPRI and inherit it from IOCB_HIPRI Jens Axboe 2018-10-29 7:47 ` Hannes Reinecke 2018-10-29 7:47 ` Hannes Reinecke 2018-10-25 21:16 ` [PATCH 14/14] nvme: add separate poll queue map Jens Axboe 2018-10-25 21:16 ` Jens Axboe 2018-10-29 7:48 ` Hannes Reinecke 2018-10-29 7:48 ` Hannes Reinecke 2018-10-29 16:37 [PATCHSET v2 0/14] blk-mq: Add support for multiple queue maps Jens Axboe 2018-10-29 16:37 ` [PATCH 13/14] block: add REQ_HIPRI and inherit it from IOCB_HIPRI Jens Axboe
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=20181025211626.12692-14-axboe@kernel.dk \ --to=axboe@kernel.dk \ --cc=linux-block@vger.kernel.org \ --cc=linux-nvme@lists.infradead.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.