linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] block: set ioprio value
@ 2019-08-21  6:11 Chaitanya Kulkarni
  2019-08-21  6:11 ` [PATCH V2 1/3] block: set ioprio for zone-reset bio Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2019-08-21  6:11 UTC (permalink / raw)
  To: linux-block, linux-kernel; +Cc: axboe, Chaitanya Kulkarni

Hi,

While experimenting with the ionice, I came across the scenario where
I cannot see the bio/request priority field being set when using
blkdiscard for REQ_OP_DISCARD, REQ_OP_WRITE_ZEROES and other operations
like REQ_OP_WRITE_SAME, REQ_OP_ZONE_RESET, and flush.

This is a small patch-series which sets the ioprio value at various
places for the zone-reset, flush, write-zeroes and discard operations.
This patch series uses get_current_ioprio() so that bio associated
with the respective operation can inherit the value from current
process.

In order to test this, I've modified the null_blk and enabled the 
write_zeroes through module param. Following are the results.

Without these patches:-  

# modprobe null_blk gb=5 nr_devices=1 write_zeroes=1
# for prio in `seq 0 3`; do ionice -c ${prio} blkdiscard -z -o 0 -l 4096 /dev/nullb0; done
# dmesg  -c 
[  402.958458] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 0
[  402.966024] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 0
[  402.973960] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 0
[  402.981373] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 0
# 

With these patches:-

# modprobe null_blk gb=5 nr_devices=1 write_zeroes=1
# for prio in `seq 0 3`; do ionice -c ${prio} blkdiscard -z -o 0 -l 4096 /dev/nullb0; done 
# dmesg  -c 
[ 1426.091772] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 0
[ 1426.100177] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 1
[ 1426.108035] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 2
[ 1426.115768] null_handle_cmd REQ_OP_WRITE_ZEROES priority class 3
# 

With the block trace extension support is being worked on [1] which has
the ability to report the I/O priority, now we can track the correct
priority values with this patch-series.

Regards,
Chaitanya

[1] https://www.spinics.net/lists/linux-btrace/msg00880.html

* Changes from V1:-
1. Adjust the code for new changes from linux-block/for-next.  

Chaitanya Kulkarni (3):
  block: set ioprio for zone-reset bio
  block: set ioprio for flush bio
  block: set ioprio for discard, write-zeroes etc

 block/blk-flush.c | 1 +
 block/blk-lib.c   | 4 ++++
 block/blk-zoned.c | 2 ++
 3 files changed, 7 insertions(+)

-- 
2.17.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-21  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21  6:11 [PATCH V2 0/3] block: set ioprio value Chaitanya Kulkarni
2019-08-21  6:11 ` [PATCH V2 1/3] block: set ioprio for zone-reset bio Chaitanya Kulkarni
2019-08-21  6:11 ` [PATCH V2 2/3] block: set ioprio for flush bio Chaitanya Kulkarni
2019-08-21  6:11 ` [PATCH V2 3/3] block: set ioprio for discard, write-zeroes etc Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).