All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-block@vger.kernel.org
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [RFC PATCH 10/18] block: set ioprio for write-zeroes, discard etc
Date: Tue, 30 Apr 2019 21:28:23 -0700	[thread overview]
Message-ID: <20190501042831.5313-11-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20190501042831.5313-1-chaitanya.kulkarni@wdc.com>

This change is required so that using tools like blkdisacrd we can
track the priority with blktrace newly added blktrace extension along
with the new operations like write-zeroes.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-lib.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 5f2c429d4378..efc9a1bf5262 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -7,6 +7,7 @@
 #include <linux/bio.h>
 #include <linux/blkdev.h>
 #include <linux/scatterlist.h>
+#include <linux/ioprio.h>
 
 #include "blk.h"
 
@@ -64,6 +65,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
 		bio->bi_iter.bi_sector = sector;
 		bio_set_dev(bio, bdev);
 		bio_set_op_attrs(bio, op, 0);
+		bio_set_prio(bio, get_current_ioprio());
 
 		bio->bi_iter.bi_size = req_sects << 9;
 		sector += req_sects;
@@ -162,6 +164,7 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
 		bio->bi_io_vec->bv_offset = 0;
 		bio->bi_io_vec->bv_len = bdev_logical_block_size(bdev);
 		bio_set_op_attrs(bio, REQ_OP_WRITE_SAME, 0);
+		bio_set_prio(bio, get_current_ioprio());
 
 		if (nr_sects > max_write_same_sectors) {
 			bio->bi_iter.bi_size = max_write_same_sectors << 9;
@@ -234,6 +237,8 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev,
 		bio->bi_iter.bi_sector = sector;
 		bio_set_dev(bio, bdev);
 		bio->bi_opf = REQ_OP_WRITE_ZEROES;
+		bio_set_prio(bio, get_current_ioprio());
+
 		if (flags & BLKDEV_ZERO_NOUNMAP)
 			bio->bi_opf |= REQ_NOUNMAP;
 
@@ -286,6 +291,7 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev,
 		bio->bi_iter.bi_sector = sector;
 		bio_set_dev(bio, bdev);
 		bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
+		bio_set_prio(bio, get_current_ioprio());
 
 		while (nr_sects != 0) {
 			sz = min((sector_t) PAGE_SIZE, nr_sects << 9);
-- 
2.19.1


  parent reply	other threads:[~2019-05-01  4:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01  4:28 [RFC PATCH 00/18] blktrace: add blktrace extension support Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 01/18] blktrace: increase the size of action mask Chaitanya Kulkarni
2019-05-01 15:48   ` Bart Van Assche
2019-05-02  3:43     ` Chaitanya Kulkarni
2019-05-02 15:12       ` Bart Van Assche
2019-05-01  4:28 ` [RFC PATCH 02/18] blktrace: add more definitions for BLK_TC_ACT Chaitanya Kulkarni
2019-05-01 12:31   ` Christoph Hellwig
2019-05-01 12:56     ` Jeff Moyer
2019-05-02  3:48       ` Chaitanya Kulkarni
2019-05-02  3:49     ` Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 03/18] blktrace: update trace to track more actions Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 04/18] kernel/trace: add KConfig to enable blktrace_ext Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 05/18] blktrace: add iopriority mask Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 06/18] " Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 07/18] blktrace: allow user to track iopriority Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 08/18] blktrace: add sysfs ioprio mask Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 09/18] blktrace: add debug support for extension Chaitanya Kulkarni
2019-05-01  4:28 ` Chaitanya Kulkarni [this message]
2019-05-01  4:28 ` [RFC PATCH 11/18] block: set ioprio for zone-reset Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 12/18] block: set ioprio for flush bio Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 13/18] drivers: set bio iopriority field Chaitanya Kulkarni
2019-05-01  6:23   ` Javier González
2019-05-01  4:28 ` [RFC PATCH 14/18] fs: " Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 15/18] power/swap: " Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 16/18] mm: " Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 17/18] null_blk: add write-zeroes flag to nullb_device Chaitanya Kulkarni
2019-05-01  4:28 ` [RFC PATCH 18/18] null_blk: add module param discard/write-zeroes Chaitanya Kulkarni

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=20190501042831.5313-11-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=linux-block@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 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.