[0/5] block: udpate debug messages with blk_op_str()
mbox series

Message ID 20190701215726.27601-1-chaitanya.kulkarni@wdc.com
Headers show
  • block: udpate debug messages with blk_op_str()
Related show


Chaitanya Kulkarni July 1, 2019, 9:57 p.m. UTC

This patch-series uses newly introduced blk_op_str() to improve
existing REQ_OP_XXX messages. The first two patches we change the
bio_check_ro() and submit_bio() and make debugging more clear and
get rid of the 1:M mapping of the REQ_OP_XXX to debug string
(such as printing "READ" and "WRITE") with the help of blk_op_str().

Later 3 patches are focused on changing the block_dump in submit_bio(),
so we can log all the operations and update the respective

This is needed as we are adding more REQ_OP_XXX with last bit set 
as a part of newly introduced Zone Block Device Zone Open, Zone Close
and Zone Finish operations which are mapped to new REQ_OP_ZONE_OPEN,
REQ_OP_ZONE_CLOSE and REQ_OP_ZONE_FINISH respectively [1].

With this patch-series, we can see the following output with respective
commands which are clear including the special REQ_OP_XXX
(Write-zeroes and Discard) :-

# blkzone reset /dev/nullb0			# Reset all the zones 
# blkdiscard -o 0 -l 4096 /dev/nullb0		# discard 8 sectors 
# blkdiscard -o 0 -l 40960 /dev/nullb0		# disacrd 80 sectors  
# blkdiscard -z -o 0 -l 40960 /dev/nullb0	# write-zero 80 sectors
# dmesg  -c 

[ 1161.922707] blkzone(10803): ZONE_RESET block 0 on nullb0 (0 sectors)
[ 1161.922735] blkzone(10803): ZONE_RESET block 524288 on nullb0 (0 sectors)
[ 1161.922750] blkzone(10803): ZONE_RESET block 1048576 on nullb0 (0 sectors)
[ 1161.922762] blkzone(10803): ZONE_RESET block 1572864 on nullb0 (0 sectors)
[ 1186.949689] blkdiscard(10834): DISCARD block 0 on nullb0 (8 sectors)
[ 1195.145731] blkdiscard(10844): DISCARD block 0 on nullb0 (80 sectors)
[ 1212.490633] blkdiscard(10854): WRITE_ZEROES block 0 on nullb0 (80 sectors)


To: linux-mm@kvack.org
To; linux-block@ linux-block@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jenx Axboe <axboe@kernel.dk>

[1] https://www.spinics.net/lists/linux-block/msg41884.html.

Chaitanya Kulkarni (5):
  block: update error message for bio_check_ro()
  block: update error message in submit_bio()
  block: allow block_dump to print all REQ_OP_XXX
  mm: update block_dump comment
  Documentation/laptop: add block_dump documentation

 Documentation/laptops/laptop-mode.txt | 16 ++++++++--------
 block/blk-core.c                      | 27 +++++++++++++--------------
 mm/page-writeback.c                   |  2 +-
 3 files changed, 22 insertions(+), 23 deletions(-)