All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] blktrace: few clenaup
@ 2021-02-02  5:25 Chaitanya Kulkarni
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
                   ` (15 more replies)
  0 siblings, 16 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Hi,

These are few cleanups for the block trace.

Below is the test log on latest linux-block/for-next.

Last two patches are needed to for testing.

-ck

Chaitanya Kulkarni (7):
  block: remove superfluous param in blk_fill_rwbs()
  blktrace: add blk_fill_rwbs documentation comment
  blktrace: fix blk_rq_issue documentation
  blktrace: fix blk_rq_merge documentation
  block: get rid of the trace rq insert wrapper
  null_blk: allow disacrd on non-membacked mode
  null_blk: add module param queue bounce limit

 block/bfq-iosched.c               |  4 +++-
 block/blk-mq-sched.c              |  6 ------
 block/blk-mq-sched.h              |  1 -
 block/kyber-iosched.c             |  4 +++-
 block/mq-deadline.c               |  4 +++-
 drivers/block/null_blk/main.c     | 31 +++++++++++++++++++++++++------
 drivers/block/null_blk/null_blk.h |  1 +
 include/linux/blktrace_api.h      |  2 +-
 include/trace/events/bcache.h     | 10 +++++-----
 include/trace/events/block.h      | 20 ++++++++++----------
 kernel/trace/blktrace.c           | 13 ++++++++++++-
 11 files changed, 63 insertions(+), 33 deletions(-)

Patch 1 Testing for uncommon tracepoints such as split, requeue :-

Merge Tracepoint :-

252,0    0        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0    0        2     0.000014217  1096  G  WS 0 + 8 [systemd-udevd]
252,0    0        3     0.000019467  1096  Q  WS 8 + 8 [systemd-udevd]
*252,0    0        4     0.000021200  1096  M  WS 8 + 8 [systemd-udevd]*
252,0    0        5     0.000025568  1096  Q  WS 16 + 8 [systemd-udevd]
252,0    0        6     0.000026540  1096  M  WS 16 + 8 [systemd-udevd]
252,0    0        7     0.000030407  1096  Q  WS 24 + 8 [systemd-udevd]
252,0    0        8     0.000031359  1096  M  WS 24 + 8 [systemd-udevd]
252,0    0        9     0.000035056  1096  Q  WS 32 + 8 [systemd-udevd]
252,0    0       10     0.000036008  1096  M  WS 32 + 8 [systemd-udevd]
252,0    0       11     0.000039234  1096  Q  WS 40 + 8 [systemd-udevd]
252,0    0       12     0.000040165  1096  M  WS 40 + 8 [systemd-udevd]
252,0    0       13     0.000043371  1096  Q  WS 48 + 8 [systemd-udevd]
252,0    0       14     0.000044293  1096  M  WS 48 + 8 [systemd-udevd]
252,0    0       15     0.000047980  1096  Q  WS 56 + 8 [systemd-udevd]
252,0    0       16     0.000048902  1096  M  WS 56 + 8 [systemd-udevd]
252,0    0       17     0.000052068  1096  Q  WS 64 + 8 [systemd-udevd]
252,0    0       18     0.000052999  1096  M  WS 64 + 8 [systemd-udevd]
252,0    0       19     0.000056486  1096  Q  WS 72 + 8 [systemd-udevd]
252,0    0       20     0.000057428  1096  M  WS 72 + 8 [systemd-udevd]
252,0    0       21     0.000061896  1096  I  WS 0 + 80 [systemd-udevd]
252,0    0       22     0.000082194  1096  D  WS 0 + 80 [systemd-udevd]
252,0    0       23     0.000107782    10  C  WS 0 + 80 [0]

ReQueue Tracepoint :-

252,0   29        1     0.000000000  6215  Q  WS 0 + 8 [dd]
252,0   29        2     0.000010109  6215  G  WS 0 + 8 [dd]
252,0   29        3     0.000014577  6215  I  WS 0 + 8 [dd]
252,0   29        4     0.000040476   807  D  WS 0 + 8 [kworker/29:1H]
*252,0   29        5     0.000043151   807  R  WS 0 + 8 [0]*
252,0   29        6     0.000049142   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29        7     0.000050244   807  R  WS 0 + 8 [0]
252,0   29        8     0.000205866   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29        9     0.000249157   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       10     0.000250379   807  R  WS 0 + 8 [0]
252,0   29       11     0.004154922   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       12     0.004157446   807  R  WS 0 + 8 [0]
252,0   29       13     0.004164249   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29       14     0.004166974   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       15     0.004168497   807  R  WS 0 + 8 [0]
252,0   29       16     0.008204045   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       17     0.008208584   807  R  WS 0 + 8 [0]
252,0   29       18     0.008220506   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29       19     0.008225405   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       20     0.008251003   157  C  WS 0 + 8 [0]
252,0   29       21     0.008309343  6215  Q  WS 8 + 8 [dd]
252,0   29       22     0.008314632  6215  G  WS 8 + 8 [dd]
252,0   29       23     0.008319391  6215  I  WS 8 + 8 [dd]
252,0   29       24     0.008339239   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       25     0.008341773   807  R  WS 8 + 8 [0]
252,0   29       26     0.008349738   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       27     0.008351862   807  R  WS 8 + 8 [0]
252,0   29       28     0.008359607   807  I  WS 8 + 8 [kworker/29:1H]
252,0   29       29     0.008362873   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       30     0.008376328   157  C  WS 8 + 8 [0]

Split  Tracepoint :-

252,0   29        1     0.000000000  5790  Q  DS 0 + 80 [blkdiscard]
*252,0   29        2     0.000003005  5790  X  DS 0 / 4 [blkdiscard]*
252,0   29        3     0.000008506  5790  G  DS 0 + 4 [blkdiscard]
252,0   29        4     0.000010610  5790  X  DS 4 / 8 [blkdiscard]
252,0   29        5     0.000012062  5790  G  DS 4 + 4 [blkdiscard]
252,0   29        6     0.000013555  5790  X  DS 8 / 12 [blkdiscard]
252,0   29        7     0.000014908  5790  G  DS 8 + 4 [blkdiscard]
252,0   29        8     0.000017062  5790  X  DS 12 / 16 [blkdiscard]
252,0   29        9     0.000018384  5790  G  DS 12 + 4 [blkdiscard]
252,0   29       10     0.000019817  5790  X  DS 16 / 20 [blkdiscard]
252,0   29       11     0.000023774  5790  I  DS 0 + 4 [blkdiscard]
252,0   29       12     0.000024556  5790  I  DS 4 + 4 [blkdiscard]
252,0   29       13     0.000025177  5790  I  DS 8 + 4 [blkdiscard]
252,0   29       14     0.000025758  5790  I  DS 12 + 4 [blkdiscard]
252,0   29       15     0.000050224   807  D  DS 0 + 4 [kworker/29:1H]
252,0   29       16     0.000056275   807  D  DS 4 + 4 [kworker/29:1H]
252,0   29       17     0.000075712   807  D  DS 8 + 4 [kworker/29:1H]
252,0   29       18     0.000076844   807  D  DS 12 + 4 [kworker/29:1H]
252,0   29       19     0.000085310   157  C  DS 0 + 4 [0]
252,0   29       20     0.000089337   157  C  DS 0 + 8 [0]
252,0   29       21     0.000096400   157  C  DS 0 + 12 [0]
252,0   29       22     0.000097913   157  C  DS 0 + 16 [0]


Patch 5 Test log Make sure rq insert works with each sched :-

# ./trace_cleanup_blktrace.sh 
8c8f1a45899a (HEAD -> for-next) null_blk: add module param queue bounce limit
37f33071ed74 null_blk: allow disacrd on non-membacked mode
19af33d82a86 block: get rid of the trace rq insert wrapper
4234aaeef927 blktrace: fix blk_rq_merge documentation
7b6e753dc655 blktrace: fix blk_rq_issue documentation
42c251311549 blktrace: add blk_fill_rwbs documentation comment
ee2ca65cac3a block: remove superfluous param in blk_fill_rwbs()
5.11.0-rc6blk+
####################     kyber     #####################
mq-deadline [kyber] none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000729117 s, 28.1 MB/s
####################     bfq     #####################
mq-deadline kyber [bfq] none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000329207 s, 62.2 MB/s
####################     mq-deadline     #####################
[mq-deadline] kyber bfq none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000333576 s, 61.4 MB/s
####################     none     #####################
[none] mq-deadline kyber bfq 
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000348243 s, 58.8 MB/s
####################     kyber     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000011121  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000162665  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000185077  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000195346  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000198382  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000210565  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000218119  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000219421  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000226925  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000232135  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000233297  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000240511  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000245701  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000246843  1096  M  WS 32 + 8 [systemd-udevd]
*252,0   45       16     0.000264746  1096  I  WS 0 + 40 [systemd-udevd]*
252,0   45       17     0.000337262  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       18     0.000526978   237  C  WS 0 + 40 [0]
252,0   45       19     0.000531887   237  C  WS 0 + 8 [0]
252,0   45       20     0.000554360   237  C  WS 8 + 8 [0]
252,0   45       21     0.000557505   237  C  WS 16 + 8 [0]
252,0   45       22     0.000560441   237  C  WS 24 + 8 [0]
252,0   45       23     0.000563457   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     bfq     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000010880  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000368781  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000380924  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000387346  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000389821  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000398728  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000405360  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000406753  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000415719  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000421210  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000422592  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000431248  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000437640  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000438973  1096  M  WS 32 + 8 [systemd-udevd]
252,0   45       16     0.000446617  1096  I  WS 0 + 40 [systemd-udevd]
*252,0   45       17     0.000560571  1096  D  WS 0 + 40 [systemd-udevd]*
252,0   45       18     0.000644438   237  C  WS 0 + 40 [0]
252,0   45       19     0.000651752   237  C  WS 0 + 8 [0]
252,0   45       20     0.000675957   237  C  WS 8 + 8 [0]
252,0   45       21     0.000683341   237  C  WS 16 + 8 [0]
252,0   45       22     0.000690044   237  C  WS 24 + 8 [0]
252,0   45       23     0.000696686   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     mq-deadline     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000011522  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000023454  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000033012  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000038813  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000041207  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000049022  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000054412  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000055574  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000062607  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000067807  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000068939  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000075762  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000081022  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000082314  1096  M  WS 32 + 8 [systemd-udevd]
*252,0   45       16     0.000251682  1096  I  WS 0 + 40 [systemd-udevd]*
252,0   45       17     0.000264386  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       18     0.000298630   237  C  WS 0 + 40 [0]
252,0   45       19     0.000305824   237  C  WS 0 + 8 [0]
252,0   45       20     0.000330520   237  C  WS 8 + 8 [0]
252,0   45       21     0.000336641   237  C  WS 16 + 8 [0]
252,0   45       22     0.000342172   237  C  WS 24 + 8 [0]
252,0   45       23     0.000347872   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     none     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000012293  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000021670  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000030807  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000035747  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000038362  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000045856  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000051807  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000053099  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000060603  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000065182  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000066324  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000073327  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000078286  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000079368  1096  M  WS 32 + 8 [systemd-udevd]
252,0   45       16     0.000086281  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       17     0.000142327   237  C  WS 0 + 40 [0]
252,0   45       18     0.000149881   237  C  WS 0 + 8 [0]
252,0   45       19     0.000174146   237  C  WS 8 + 8 [0]
252,0   45       20     0.000180067   237  C  WS 16 + 8 [0]
252,0   45       21     0.000185668   237  C  WS 24 + 8 [0]
252,0   45       22     0.000191499   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 22 entries
Skips: 0 forward (0 -   0.0%)


-- 
2.22.1


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

* [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:02   ` Damien Le Moal
                     ` (2 more replies)
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
                   ` (14 subsequent siblings)
  15 siblings, 3 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The last parameter for the function blk_fill_rwbs() was added in
5782138e47 ("tracing/events: convert block trace points to
TRACE_EVENT()") in order to signal read request and use of that parameter
was replaced with using switch case REQ_OP_READ with
1b9a9ab78b0 ("blktrace: use op accessors"), but the parameter was never
removed.

Remove the unused parameter and adjust the respective call sites.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/linux/blktrace_api.h  |  2 +-
 include/trace/events/bcache.h | 10 +++++-----
 include/trace/events/block.h  | 16 ++++++++--------
 kernel/trace/blktrace.c       |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 05556573b896..11484f1d19a1 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -119,7 +119,7 @@ struct compat_blk_user_trace_setup {
 
 #endif
 
-extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes);
+extern void blk_fill_rwbs(char *rwbs, unsigned int op);
 
 static inline sector_t blk_rq_trace_sector(struct request *rq)
 {
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index e41c611d6d3b..899fdacf57b9 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(bcache_request,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->orig_sector	= bio->bi_iter.bi_sector - 16;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
@@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d  %s %llu + %u",
@@ -137,7 +137,7 @@ TRACE_EVENT(bcache_read,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		__entry->cache_hit = hit;
 		__entry->bypass = bypass;
 	),
@@ -168,7 +168,7 @@ TRACE_EVENT(bcache_write,
 		__entry->inode		= inode;
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		__entry->writeback = writeback;
 		__entry->bypass = bypass;
 	),
@@ -238,7 +238,7 @@ TRACE_EVENT(bcache_journal_write,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
 		__entry->nr_keys	= keys;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d  %s %llu + %u keys %u",
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 0d782663a005..879cba8bdfca 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -89,7 +89,7 @@ TRACE_EVENT(block_rq_requeue,
 		__entry->sector    = blk_rq_trace_sector(rq);
 		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 	),
 
@@ -133,7 +133,7 @@ TRACE_EVENT(block_rq_complete,
 		__entry->nr_sector = nr_bytes >> 9;
 		__entry->error     = error;
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes);
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 	),
 
@@ -166,7 +166,7 @@ DECLARE_EVENT_CLASS(block_rq,
 		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
 		__entry->bytes     = blk_rq_bytes(rq);
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
@@ -249,7 +249,7 @@ TRACE_EVENT(block_bio_complete,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio_sectors(bio);
 		__entry->error		= blk_status_to_errno(bio->bi_status);
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u [%d]",
@@ -276,7 +276,7 @@ DECLARE_EVENT_CLASS(block_bio,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio_sectors(bio);
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
 
@@ -433,7 +433,7 @@ TRACE_EVENT(block_split,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->new_sector	= new_sector;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
 
@@ -474,7 +474,7 @@ TRACE_EVENT(block_bio_remap,
 		__entry->nr_sector	= bio_sectors(bio);
 		__entry->old_dev	= dev;
 		__entry->old_sector	= from;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
@@ -518,7 +518,7 @@ TRACE_EVENT(block_rq_remap,
 		__entry->old_dev	= dev;
 		__entry->old_sector	= from;
 		__entry->nr_bios	= blk_rq_count_bios(rq);
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 	),
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 9e9ee4945043..8a2591c7aa41 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1867,7 +1867,7 @@ void blk_trace_remove_sysfs(struct device *dev)
 
 #ifdef CONFIG_EVENT_TRACING
 
-void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes)
+void blk_fill_rwbs(char *rwbs, unsigned int op)
 {
 	int i = 0;
 
-- 
2.22.1


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

* [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:03   ` Damien Le Moal
  2021-02-02  9:55   ` Johannes Thumshirn
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
                   ` (13 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

blk_fill_rwbs() is an expoted function, add kernel style documentation
comment.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 kernel/trace/blktrace.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8a2591c7aa41..1a931afcf5c4 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1867,6 +1867,16 @@ void blk_trace_remove_sysfs(struct device *dev)
 
 #ifdef CONFIG_EVENT_TRACING
 
+/**
+ * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string.
+ * @rwbs	buffer to be filled
+ * @op:		REQ_OP_XXX for the tracepoint
+ *
+ * Description:
+ *     Maps the REQ_OP_XXX to character and fills the buffer provided by the
+ *     caller with resulting string.
+ *
+ **/
 void blk_fill_rwbs(char *rwbs, unsigned int op)
 {
 	int i = 0;
-- 
2.22.1


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

* [PATCH 3/7] blktrace: fix blk_rq_issue documentation
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:04   ` Damien Le Moal
  2021-02-02  9:56   ` Johannes Thumshirn
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
                   ` (12 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The commit 881245dcff29 ("Add DocBook documentation for the block tracepoints.")
added the comment for blk_rq_issue() tracepoint. Remove the duplicate
word from the tracepoint documentation.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/trace/events/block.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 879cba8bdfca..004cfe34ef37 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -196,7 +196,7 @@ DEFINE_EVENT(block_rq, block_rq_insert,
 
 /**
  * block_rq_issue - issue pending block IO request operation to device driver
- * @rq: block IO operation operation request
+ * @rq: block IO operation request
  *
  * Called when block operation request @rq from queue @q is sent to a
  * device driver for processing.
-- 
2.22.1


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

* [PATCH 4/7] blktrace: fix blk_rq_merge documentation
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (2 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:05   ` Damien Le Moal
  2021-02-02  9:57   ` Johannes Thumshirn
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
                   ` (11 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The commit f3bdc62fd82e ("blktrace: Provide event for request merging")
added the comment for blk_rq_merge() tracepoint. Remove the duplicate
word from the tracepoint documentation.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/trace/events/block.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 004cfe34ef37..cc5ab96a7471 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -210,7 +210,7 @@ DEFINE_EVENT(block_rq, block_rq_issue,
 
 /**
  * block_rq_merge - merge request with another one in the elevator
- * @rq: block IO operation operation request
+ * @rq: block IO operation request
  *
  * Called when block operation request @rq from queue @q is merged to another
  * request queued in the elevator.
-- 
2.22.1


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

* [PATCH 5/7] block: get rid of the trace rq insert wrapper
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (3 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:05   ` Damien Le Moal
  2021-02-02  9:58   ` Johannes Thumshirn
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
                   ` (10 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Get rid of the wrapper for trace_block_rq_insert() and call the function
directly.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/bfq-iosched.c     | 4 +++-
 block/blk-mq-sched.c    | 6 ------
 block/blk-mq-sched.h    | 1 -
 block/kyber-iosched.c   | 4 +++-
 block/mq-deadline.c     | 4 +++-
 kernel/trace/blktrace.c | 1 +
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index dfa87e360d71..da5e1f620625 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -125,6 +125,8 @@
 #include <linux/delay.h>
 #include <linux/backing-dev.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-tag.h"
@@ -5621,7 +5623,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	spin_unlock_irq(&bfqd->lock);
 
-	blk_mq_sched_request_inserted(rq);
+	trace_block_rq_insert(rq);
 
 	spin_lock_irq(&bfqd->lock);
 	bfqq = bfq_init_rq(rq);
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index deff4e826e23..ddb65e9e6fd9 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -384,12 +384,6 @@ bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq)
 }
 EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge);
 
-void blk_mq_sched_request_inserted(struct request *rq)
-{
-	trace_block_rq_insert(rq);
-}
-EXPORT_SYMBOL_GPL(blk_mq_sched_request_inserted);
-
 static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx,
 				       bool has_sched,
 				       struct request *rq)
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index 0476360f05f1..5b18ab915c65 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -7,7 +7,6 @@
 
 void blk_mq_sched_assign_ioc(struct request *rq);
 
-void blk_mq_sched_request_inserted(struct request *rq);
 bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio,
 		unsigned int nr_segs, struct request **merged_request);
 bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index c25c41d0d061..f13da10953bf 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -13,6 +13,8 @@
 #include <linux/module.h>
 #include <linux/sbitmap.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
@@ -602,7 +604,7 @@ static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
 			list_move_tail(&rq->queuelist, head);
 		sbitmap_set_bit(&khd->kcq_map[sched_domain],
 				rq->mq_ctx->index_hw[hctx->type]);
-		blk_mq_sched_request_inserted(rq);
+		trace_block_rq_insert(rq);
 		spin_unlock(&kcq->lock);
 	}
 }
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index b57470e154c8..f3631a287466 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -18,6 +18,8 @@
 #include <linux/rbtree.h>
 #include <linux/sbitmap.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
@@ -496,7 +498,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 	if (blk_mq_sched_try_insert_merge(q, rq))
 		return;
 
-	blk_mq_sched_request_inserted(rq);
+	trace_block_rq_insert(rq);
 
 	if (at_head || blk_rq_is_passthrough(rq)) {
 		if (at_head)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 1a931afcf5c4..259635217a53 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -852,6 +852,7 @@ static void blk_add_trace_rq_issue(void *ignore, struct request *rq)
 	blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_ISSUE,
 			 blk_trace_request_get_cgid(rq));
 }
+EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_insert);
 
 static void blk_add_trace_rq_merge(void *ignore, struct request *rq)
 {
-- 
2.22.1


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

* [PATCH 6/7] null_blk: allow disacrd on non-membacked mode
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (4 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:08   ` Damien Le Moal
  2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

null blk driver supports REQ_OP_DISACRD in membacked mode. When testing
special requests having REQ_OP_DISCARD support is helpful to validate
the special request path when mixed with read-write.

Consider module parameter when setting the queue discard flag when
device is not memory backed.

This is needed to test the tracepoint related to REQ_OP_DISCARD.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
# modprobe  -r null_blk
# gitlog -7 
4ac4d49e1028 (HEAD -> for-next) null_blk: add module param queue bounce limit
468e3617dae8 null_blk: allow disacrd on non-membacked mode
bdc96efe9681 block: get rid of the trace rq insert wrapper
73bf523a7ce4 blktrace: fix blk_rq_merge documentation
6016632555da blktrace: fix blk_rq_issue documentation
58b5d7103a94 blktrace: add blk_fill_rwbs documentation comment
534f321f57dd block: remove superfluous param in blk_fill_rwbs()

Test to exercise module parameter vs configfs discard param, set up
nullb0 such a way that it errors out in both cases for module param
discard :-

for discard in 0 1
do 
	modprobe -r null_blk
	i=0
	echo "Module param discard ${discard}"
	modprobe null_blk nr_devices=0 discard=${discard}
	# Create dev 0 no discard 
	NULLB_DIR=config/nullb/nullb${i}
	mkdir config/nullb/nullb${i}
	echo 1 > config/nullb/nullb${i}/memory_backed
	echo 512 > config/nullb/nullb${i}/blocksize 
	echo 2048 > config/nullb/nullb${i}/size 
	echo 1 > config/nullb/nullb${i}/power
	echo -n "$nullb${i} membacked : ";
	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
	echo -n "$nullb${i} discard   : ";
	cat /sys/kernel/config/nullb/nullb${i}/discard
	# Create dev 1 with discard 
	i=1
	NULLB_DIR=config/nullb/nullb${i}
	mkdir config/nullb/nullb${i}
	echo 1 > config/nullb/nullb${i}/memory_backed
	echo 512 > config/nullb/nullb${i}/blocksize 
	echo 2048 > config/nullb/nullb${i}/size 
	echo 1 > config/nullb/nullb${i}/discard
	echo 1 > config/nullb/nullb${i}/power
	echo -n "$nullb${i} membacked : ";
	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
	echo -n "$nullb${i} discard   : ";
	cat /sys/kernel/config/nullb/nullb${i}/discard

	# should fail 
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	# should pass
	blkdiscard -o 0 -l 1024 /dev/nullb1

	echo 0 > config/nullb/nullb0/power
	echo 0 > config/nullb/nullb1/power
	rmdir config/nullb/nullb*

	modprobe -r null_blk
	modprobe null_blk
	# should fail 
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	modprobe -r null_blk
	modprobe null_blk discard=1
	# should pass
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	modprobe -r null_blk
	echo "--------------------------"
done

modprobe -r null_blk
modprobe null_blk
blkdiscard -o 0 -l 1024 /dev/nullb0 
modprobe -r null_blk
modprobe null_blk discard=1
blkdiscard -o 0 -l 1024 /dev/nullb0 
modprobe -r null_blk

# ./discard_module_param_test.sh 
Module param discard 0
0 membacked : 1
0 discard   : 0
1 membacked : 1
1 discard   : 1
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
--------------------------
Module param discard 1
0 membacked : 1
0 discard   : 0
1 membacked : 1
1 discard   : 1
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
--------------------------
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
---
 drivers/block/null_blk/main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index d6c821d48090..6e6cbb953a12 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -172,6 +172,10 @@ static bool g_shared_tag_bitmap;
 module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444);
 MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq");
 
+static bool g_discard;
+module_param_named(discard, g_discard, bool, 0444);
+MODULE_PARM_DESC(discard, "Enable queue discard (default: false)");
+
 static int g_irqmode = NULL_IRQ_SOFTIRQ;
 
 static int null_set_irqmode(const char *str, const struct kernel_param *kp)
@@ -1588,14 +1592,11 @@ static void null_del_dev(struct nullb *nullb)
 
 static void null_config_discard(struct nullb *nullb)
 {
-	if (nullb->dev->discard == false)
+	if (nullb->dev->memory_backed && nullb->dev->discard == false)
 		return;
 
-	if (!nullb->dev->memory_backed) {
-		nullb->dev->discard = false;
-		pr_info("discard option is ignored without memory backing\n");
+	if (!nullb->dev->memory_backed && !g_discard)
 		return;
-	}
 
 	if (nullb->dev->zoned) {
 		nullb->dev->discard = false;
-- 
2.22.1


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

* [PATCH 7/7] null_blk: add module param queue bounce limit
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (5 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:18   ` Damien Le Moal
  2021-02-02  5:25 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

This patch adds a new module parameter to set the queue bounce limit.
Various queue limits parameters are usually present in the sysfs.
This is needed for testing purpose only so instead of poluting the
sysfs space just update the null_blk drivers.

This is needed especially for blktrace bounce related tracepoint
testing.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
# modprobe null_blk bounce_pfn=0x1000
# for bs in 512 1024 2048 4096 8192
> do
> 	dd if=/dev/zero of=/dev/nullb0 bs=${bs} count=1 oflag=direct
> done
# ~/blktrace/blktrace -a write -d /dev/nullb0 -o -| ~/blktrace/blkparse -i -
#
# # With null_blk bounce 
# modprobe null_blk bounce_pfn=0x1000
#
252,0   34        1     0.000000000  4390  Q  WS 0 + 1 [dd]
252,0   34        2     0.000010139  4390  B  WS 0 + 1 [dd]
252,0   34        3     0.000018996  4390  G  WS 0 + 1 [dd]
252,0   34        4     0.000024576  4390  I  WS 0 + 1 [dd]
252,0   34        5     0.000065152   829  D  WS 0 + 1 [kworker/34:1H]
252,0   34        6     0.000092303   182  C  WS 0 + 1 [0]
252,0   34        7     0.000098164   182  C  WS 0 + 1 [0]
252,0   27        1     0.004573597  4391  Q  WS 0 + 2 [dd]
252,0   27        2     0.004580891  4391  B  WS 0 + 2 [dd]
252,0   27        3     0.004589687  4391  G  WS 0 + 2 [dd]
252,0   27        4     0.004594356  4391  I  WS 0 + 2 [dd]
252,0   27        5     0.004619473  1049  D  WS 0 + 2 [kworker/27:1H]
252,0   27        6     0.004634411   147  C  WS 0 + 2 [0]
252,0   27        7     0.004638609   147  C  WS 0 + 2 [0]
252,0   29        1     0.014589610  4394  Q  WS 0 + 8 [dd]
252,0   29        2     0.014595792  4394  B  WS 0 + 8 [dd]
252,0   29        3     0.014599028  4394  G  WS 0 + 8 [dd]
252,0   29        4     0.014601713  4394  I  WS 0 + 8 [dd]
252,0   29        5     0.014621330   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29        6     0.014633813   157  C  WS 0 + 8 [0]
252,0   29        7     0.014637660   157  C  WS 0 + 8 [0]
252,0   30        1     0.009147174  4392  Q  WS 0 + 4 [dd]
252,0   30        2     0.009154377  4392  B  WS 0 + 4 [dd]
252,0   30        3     0.009163064  4392  G  WS 0 + 4 [dd]
252,0   30        4     0.009167161  4392  I  WS 0 + 4 [dd]
252,0   30        5     0.009191437  1084  D  WS 0 + 4 [kworker/30:1H]
252,0   30        6     0.009206084   162  C  WS 0 + 4 [0]
252,0   30        7     0.009210863   162  C  WS 0 + 4 [0]
252,0   30        8     0.018510473  4395  Q  WS 0 + 16 [dd]
252,0   30        9     0.018517767  4395  B  WS 0 + 16 [dd]
252,0   30       10     0.018521213  4395  G  WS 0 + 16 [dd]
252,0   30       11     0.018524229  4395  I  WS 0 + 16 [dd]
252,0   30       12     0.018544026  1084  D  WS 0 + 16 [kworker/30:1H]
252,0   30       13     0.018555127   162  C  WS 0 + 16 [0]
252,0   30       14     0.018558333   162  C  WS 0 + 16 [0]

# # Without null_blk bounce 
252,0   38        1     0.000000000  4744  Q  WS 0 + 1 [dd]
252,0   38        2     0.000014768  4744  G  WS 0 + 1 [dd]
252,0   38        3     0.000021771  4744  I  WS 0 + 1 [dd]
252,0   38        4     0.000062557   914  D  WS 0 + 1 [kworker/38:1H]
252,0   38        5     0.000089768   202  C  WS 0 + 1 [0]
252,0   32        1     0.018453947  4749  Q  WS 0 + 16 [dd]
252,0   32        2     0.018466080  4749  G  WS 0 + 16 [dd]
252,0   32        3     0.018470619  4749  I  WS 0 + 16 [dd]
252,0   32        4     0.018495195   514  D  WS 0 + 16 [kworker/32:1H]
252,0   32        5     0.018509942   172  C  WS 0 + 16 [0]
252,0   55        1     0.005000087  4745  Q  WS 0 + 2 [dd]
252,0   55        2     0.005005637  4745  G  WS 0 + 2 [dd]
252,0   55        3     0.005008453  4745  I  WS 0 + 2 [dd]
252,0   55        4     0.005029352  1082  D  WS 0 + 2 [kworker/55:1H]
252,0   55        5     0.005041915   287  C  WS 0 + 2 [0]
252,0   31        1     0.014158231  4748  Q  WS 0 + 8 [dd]
252,0   31        2     0.014164173  4748  G  WS 0 + 8 [dd]
252,0   31        3     0.014167308  4748  I  WS 0 + 8 [dd]
252,0   31        4     0.014188759  1151  D  WS 0 + 8 [kworker/31:1H]
252,0   31        5     0.014203015   167  C  WS 0 + 8 [0]
252,0   58        1     0.010016655  4747  D  WS 0 + 4 [systemd-udevd]
252,0   60        1     0.009982571  4746  Q  WS 0 + 4 [dd]
252,0   60        2     0.009993942  4746  G  WS 0 + 4 [dd]
252,0   60        3     0.009998661  4746  I  WS 0 + 4 [dd]
252,0   60        4     0.010136269     0  C  WS 0 + 4 [0]

---
 drivers/block/null_blk/main.c     | 20 +++++++++++++++++++-
 drivers/block/null_blk/null_blk.h |  1 +
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 6e6cbb953a12..8ddf2ba961f7 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -156,6 +156,10 @@ static int g_max_sectors;
 module_param_named(max_sectors, g_max_sectors, int, 0444);
 MODULE_PARM_DESC(max_sectors, "Maximum size of a command (in 512B sectors)");
 
+static unsigned int g_bounce_pfn;
+module_param_named(bounce_pfn, g_bounce_pfn, int, 0444);
+MODULE_PARM_DESC(bounce_pfn, "Queue Bounce limit (default: 0)");
+
 static unsigned int nr_devices = 1;
 module_param(nr_devices, uint, 0444);
 MODULE_PARM_DESC(nr_devices, "Number of devices to register");
@@ -354,6 +358,7 @@ NULLB_DEVICE_ATTR(submit_queues, uint, nullb_apply_submit_queues);
 NULLB_DEVICE_ATTR(home_node, uint, NULL);
 NULLB_DEVICE_ATTR(queue_mode, uint, NULL);
 NULLB_DEVICE_ATTR(blocksize, uint, NULL);
+NULLB_DEVICE_ATTR(bounce_pfn, uint, NULL);
 NULLB_DEVICE_ATTR(max_sectors, uint, NULL);
 NULLB_DEVICE_ATTR(irqmode, uint, NULL);
 NULLB_DEVICE_ATTR(hw_queue_depth, uint, NULL);
@@ -472,6 +477,7 @@ static struct configfs_attribute *nullb_device_attrs[] = {
 	&nullb_device_attr_home_node,
 	&nullb_device_attr_queue_mode,
 	&nullb_device_attr_blocksize,
+	&nullb_device_attr_bounce_pfn,
 	&nullb_device_attr_max_sectors,
 	&nullb_device_attr_irqmode,
 	&nullb_device_attr_hw_queue_depth,
@@ -543,7 +549,7 @@ nullb_group_drop_item(struct config_group *group, struct config_item *item)
 static ssize_t memb_group_features_show(struct config_item *item, char *page)
 {
 	return snprintf(page, PAGE_SIZE,
-			"memory_backed,discard,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv,zone_max_open,zone_max_active,blocksize,max_sectors\n");
+			"memory_backed,discard,bounce_pfn,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv\n");
 }
 
 CONFIGFS_ATTR_RO(memb_group_, features);
@@ -1610,6 +1616,17 @@ static void null_config_discard(struct nullb *nullb)
 	blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q);
 }
 
+static void null_config_bounce_pfn(struct nullb *nullb)
+{
+	if (nullb->dev->memory_backed && nullb->dev->bounce_pfn == false)
+		return;
+
+	if (!nullb->dev->memory_backed && !g_bounce_pfn)
+		return;
+
+	blk_queue_bounce_limit(nullb->q, nullb->dev->bounce_pfn);
+}
+
 static const struct block_device_operations null_bio_ops = {
 	.owner		= THIS_MODULE,
 	.submit_bio	= null_submit_bio,
@@ -1882,6 +1899,7 @@ static int null_add_dev(struct nullb_device *dev)
 	blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
 
 	null_config_discard(nullb);
+	null_config_bounce_pfn(nullb);
 
 	sprintf(nullb->disk_name, "nullb%d", nullb->index);
 
diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h
index 83504f3cc9d6..cd55f99118bf 100644
--- a/drivers/block/null_blk/null_blk.h
+++ b/drivers/block/null_blk/null_blk.h
@@ -86,6 +86,7 @@ struct nullb_device {
 	unsigned int queue_mode; /* block interface */
 	unsigned int blocksize; /* block size */
 	unsigned int max_sectors; /* Max sectors per command */
+	unsigned int bounce_pfn; /* bounce page frame number */
 	unsigned int irqmode; /* IRQ completion handler */
 	unsigned int hw_queue_depth; /* queue depth */
 	unsigned int index; /* index of the disk, only valid with a disk */
-- 
2.22.1


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

* [PATCH 0/7] blktrace: few clenaup
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (6 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Hi,

These are few cleanups for the block trace.

Below is the test log on latest linux-block/for-next.

Last two patches are needed to for testing.

-ck

Chaitanya Kulkarni (7):
  block: remove superfluous param in blk_fill_rwbs()
  blktrace: add blk_fill_rwbs documentation comment
  blktrace: fix blk_rq_issue documentation
  blktrace: fix blk_rq_merge documentation
  block: get rid of the trace rq insert wrapper
  null_blk: allow disacrd on non-membacked mode
  null_blk: add module param queue bounce limit

 block/bfq-iosched.c               |  4 +++-
 block/blk-mq-sched.c              |  6 ------
 block/blk-mq-sched.h              |  1 -
 block/kyber-iosched.c             |  4 +++-
 block/mq-deadline.c               |  4 +++-
 drivers/block/null_blk/main.c     | 31 +++++++++++++++++++++++++------
 drivers/block/null_blk/null_blk.h |  1 +
 include/linux/blktrace_api.h      |  2 +-
 include/trace/events/bcache.h     | 10 +++++-----
 include/trace/events/block.h      | 20 ++++++++++----------
 kernel/trace/blktrace.c           | 13 ++++++++++++-
 11 files changed, 63 insertions(+), 33 deletions(-)

Patch 1 Testing for uncommon tracepoints such as split, requeue :-

Merge Tracepoint :-

252,0    0        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0    0        2     0.000014217  1096  G  WS 0 + 8 [systemd-udevd]
252,0    0        3     0.000019467  1096  Q  WS 8 + 8 [systemd-udevd]
*252,0    0        4     0.000021200  1096  M  WS 8 + 8 [systemd-udevd]*
252,0    0        5     0.000025568  1096  Q  WS 16 + 8 [systemd-udevd]
252,0    0        6     0.000026540  1096  M  WS 16 + 8 [systemd-udevd]
252,0    0        7     0.000030407  1096  Q  WS 24 + 8 [systemd-udevd]
252,0    0        8     0.000031359  1096  M  WS 24 + 8 [systemd-udevd]
252,0    0        9     0.000035056  1096  Q  WS 32 + 8 [systemd-udevd]
252,0    0       10     0.000036008  1096  M  WS 32 + 8 [systemd-udevd]
252,0    0       11     0.000039234  1096  Q  WS 40 + 8 [systemd-udevd]
252,0    0       12     0.000040165  1096  M  WS 40 + 8 [systemd-udevd]
252,0    0       13     0.000043371  1096  Q  WS 48 + 8 [systemd-udevd]
252,0    0       14     0.000044293  1096  M  WS 48 + 8 [systemd-udevd]
252,0    0       15     0.000047980  1096  Q  WS 56 + 8 [systemd-udevd]
252,0    0       16     0.000048902  1096  M  WS 56 + 8 [systemd-udevd]
252,0    0       17     0.000052068  1096  Q  WS 64 + 8 [systemd-udevd]
252,0    0       18     0.000052999  1096  M  WS 64 + 8 [systemd-udevd]
252,0    0       19     0.000056486  1096  Q  WS 72 + 8 [systemd-udevd]
252,0    0       20     0.000057428  1096  M  WS 72 + 8 [systemd-udevd]
252,0    0       21     0.000061896  1096  I  WS 0 + 80 [systemd-udevd]
252,0    0       22     0.000082194  1096  D  WS 0 + 80 [systemd-udevd]
252,0    0       23     0.000107782    10  C  WS 0 + 80 [0]

ReQueue Tracepoint :-

252,0   29        1     0.000000000  6215  Q  WS 0 + 8 [dd]
252,0   29        2     0.000010109  6215  G  WS 0 + 8 [dd]
252,0   29        3     0.000014577  6215  I  WS 0 + 8 [dd]
252,0   29        4     0.000040476   807  D  WS 0 + 8 [kworker/29:1H]
*252,0   29        5     0.000043151   807  R  WS 0 + 8 [0]*
252,0   29        6     0.000049142   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29        7     0.000050244   807  R  WS 0 + 8 [0]
252,0   29        8     0.000205866   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29        9     0.000249157   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       10     0.000250379   807  R  WS 0 + 8 [0]
252,0   29       11     0.004154922   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       12     0.004157446   807  R  WS 0 + 8 [0]
252,0   29       13     0.004164249   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29       14     0.004166974   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       15     0.004168497   807  R  WS 0 + 8 [0]
252,0   29       16     0.008204045   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       17     0.008208584   807  R  WS 0 + 8 [0]
252,0   29       18     0.008220506   807  I  WS 0 + 8 [kworker/29:1H]
252,0   29       19     0.008225405   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29       20     0.008251003   157  C  WS 0 + 8 [0]
252,0   29       21     0.008309343  6215  Q  WS 8 + 8 [dd]
252,0   29       22     0.008314632  6215  G  WS 8 + 8 [dd]
252,0   29       23     0.008319391  6215  I  WS 8 + 8 [dd]
252,0   29       24     0.008339239   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       25     0.008341773   807  R  WS 8 + 8 [0]
252,0   29       26     0.008349738   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       27     0.008351862   807  R  WS 8 + 8 [0]
252,0   29       28     0.008359607   807  I  WS 8 + 8 [kworker/29:1H]
252,0   29       29     0.008362873   807  D  WS 8 + 8 [kworker/29:1H]
252,0   29       30     0.008376328   157  C  WS 8 + 8 [0]

Split  Tracepoint :-

252,0   29        1     0.000000000  5790  Q  DS 0 + 80 [blkdiscard]
*252,0   29        2     0.000003005  5790  X  DS 0 / 4 [blkdiscard]*
252,0   29        3     0.000008506  5790  G  DS 0 + 4 [blkdiscard]
252,0   29        4     0.000010610  5790  X  DS 4 / 8 [blkdiscard]
252,0   29        5     0.000012062  5790  G  DS 4 + 4 [blkdiscard]
252,0   29        6     0.000013555  5790  X  DS 8 / 12 [blkdiscard]
252,0   29        7     0.000014908  5790  G  DS 8 + 4 [blkdiscard]
252,0   29        8     0.000017062  5790  X  DS 12 / 16 [blkdiscard]
252,0   29        9     0.000018384  5790  G  DS 12 + 4 [blkdiscard]
252,0   29       10     0.000019817  5790  X  DS 16 / 20 [blkdiscard]
252,0   29       11     0.000023774  5790  I  DS 0 + 4 [blkdiscard]
252,0   29       12     0.000024556  5790  I  DS 4 + 4 [blkdiscard]
252,0   29       13     0.000025177  5790  I  DS 8 + 4 [blkdiscard]
252,0   29       14     0.000025758  5790  I  DS 12 + 4 [blkdiscard]
252,0   29       15     0.000050224   807  D  DS 0 + 4 [kworker/29:1H]
252,0   29       16     0.000056275   807  D  DS 4 + 4 [kworker/29:1H]
252,0   29       17     0.000075712   807  D  DS 8 + 4 [kworker/29:1H]
252,0   29       18     0.000076844   807  D  DS 12 + 4 [kworker/29:1H]
252,0   29       19     0.000085310   157  C  DS 0 + 4 [0]
252,0   29       20     0.000089337   157  C  DS 0 + 8 [0]
252,0   29       21     0.000096400   157  C  DS 0 + 12 [0]
252,0   29       22     0.000097913   157  C  DS 0 + 16 [0]


Patch 5 Test log Make sure rq insert works with each sched :-

# ./trace_cleanup_blktrace.sh 
8c8f1a45899a (HEAD -> for-next) null_blk: add module param queue bounce limit
37f33071ed74 null_blk: allow disacrd on non-membacked mode
19af33d82a86 block: get rid of the trace rq insert wrapper
4234aaeef927 blktrace: fix blk_rq_merge documentation
7b6e753dc655 blktrace: fix blk_rq_issue documentation
42c251311549 blktrace: add blk_fill_rwbs documentation comment
ee2ca65cac3a block: remove superfluous param in blk_fill_rwbs()
5.11.0-rc6blk+
####################     kyber     #####################
mq-deadline [kyber] none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000729117 s, 28.1 MB/s
####################     bfq     #####################
mq-deadline kyber [bfq] none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000329207 s, 62.2 MB/s
####################     mq-deadline     #####################
[mq-deadline] kyber bfq none
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000333576 s, 61.4 MB/s
####################     none     #####################
[none] mq-deadline kyber bfq 
5+0 records in
5+0 records out
20480 bytes (20 kB) copied, 0.000348243 s, 58.8 MB/s
####################     kyber     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000011121  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000162665  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000185077  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000195346  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000198382  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000210565  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000218119  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000219421  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000226925  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000232135  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000233297  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000240511  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000245701  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000246843  1096  M  WS 32 + 8 [systemd-udevd]
*252,0   45       16     0.000264746  1096  I  WS 0 + 40 [systemd-udevd]*
252,0   45       17     0.000337262  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       18     0.000526978   237  C  WS 0 + 40 [0]
252,0   45       19     0.000531887   237  C  WS 0 + 8 [0]
252,0   45       20     0.000554360   237  C  WS 8 + 8 [0]
252,0   45       21     0.000557505   237  C  WS 16 + 8 [0]
252,0   45       22     0.000560441   237  C  WS 24 + 8 [0]
252,0   45       23     0.000563457   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     bfq     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000010880  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000368781  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000380924  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000387346  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000389821  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000398728  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000405360  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000406753  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000415719  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000421210  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000422592  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000431248  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000437640  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000438973  1096  M  WS 32 + 8 [systemd-udevd]
252,0   45       16     0.000446617  1096  I  WS 0 + 40 [systemd-udevd]
*252,0   45       17     0.000560571  1096  D  WS 0 + 40 [systemd-udevd]*
252,0   45       18     0.000644438   237  C  WS 0 + 40 [0]
252,0   45       19     0.000651752   237  C  WS 0 + 8 [0]
252,0   45       20     0.000675957   237  C  WS 8 + 8 [0]
252,0   45       21     0.000683341   237  C  WS 16 + 8 [0]
252,0   45       22     0.000690044   237  C  WS 24 + 8 [0]
252,0   45       23     0.000696686   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     mq-deadline     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000011522  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000023454  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000033012  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000038813  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000041207  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000049022  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000054412  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000055574  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000062607  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000067807  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000068939  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000075762  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000081022  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000082314  1096  M  WS 32 + 8 [systemd-udevd]
*252,0   45       16     0.000251682  1096  I  WS 0 + 40 [systemd-udevd]*
252,0   45       17     0.000264386  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       18     0.000298630   237  C  WS 0 + 40 [0]
252,0   45       19     0.000305824   237  C  WS 0 + 8 [0]
252,0   45       20     0.000330520   237  C  WS 8 + 8 [0]
252,0   45       21     0.000336641   237  C  WS 16 + 8 [0]
252,0   45       22     0.000342172   237  C  WS 24 + 8 [0]
252,0   45       23     0.000347872   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 23 entries
Skips: 0 forward (0 -   0.0%)
####################     none     #####################
252,0   45        1     0.000000000  1096  Q  WS 0 + 8 [systemd-udevd]
252,0   45        2     0.000012293  1096  B  WS 0 + 8 [systemd-udevd]
252,0   45        3     0.000021670  1096  G  WS 0 + 8 [systemd-udevd]
252,0   45        4     0.000030807  1096  Q  WS 8 + 8 [systemd-udevd]
252,0   45        5     0.000035747  1096  B  WS 8 + 8 [systemd-udevd]
252,0   45        6     0.000038362  1096  M  WS 8 + 8 [systemd-udevd]
252,0   45        7     0.000045856  1096  Q  WS 16 + 8 [systemd-udevd]
252,0   45        8     0.000051807  1096  B  WS 16 + 8 [systemd-udevd]
252,0   45        9     0.000053099  1096  M  WS 16 + 8 [systemd-udevd]
252,0   45       10     0.000060603  1096  Q  WS 24 + 8 [systemd-udevd]
252,0   45       11     0.000065182  1096  B  WS 24 + 8 [systemd-udevd]
252,0   45       12     0.000066324  1096  M  WS 24 + 8 [systemd-udevd]
252,0   45       13     0.000073327  1096  Q  WS 32 + 8 [systemd-udevd]
252,0   45       14     0.000078286  1096  B  WS 32 + 8 [systemd-udevd]
252,0   45       15     0.000079368  1096  M  WS 32 + 8 [systemd-udevd]
252,0   45       16     0.000086281  1096  D  WS 0 + 40 [systemd-udevd]
252,0   45       17     0.000142327   237  C  WS 0 + 40 [0]
252,0   45       18     0.000149881   237  C  WS 0 + 8 [0]
252,0   45       19     0.000174146   237  C  WS 8 + 8 [0]
252,0   45       20     0.000180067   237  C  WS 16 + 8 [0]
252,0   45       21     0.000185668   237  C  WS 24 + 8 [0]
252,0   45       22     0.000191499   237  C  WS 32 + 8 [0]
CPU45 (252,0):
 Reads Queued:           0,        0KiB	 Writes Queued:           5,       20KiB
 Read Dispatches:        0,        0KiB	 Write Dispatches:        1,       20KiB
 Reads Requeued:         0		 Writes Requeued:         0
 Reads Completed:        0,        0KiB	 Writes Completed:        6,       40KiB
 Read Merges:            0,        0KiB	 Write Merges:            4,       16KiB
 Read depth:             0        	 Write depth:             1
 IO unplugs:             0        	 Timer unplugs:           0

Throughput (R/W): 0KiB/s / 0KiB/s
Events (252,0): 22 entries
Skips: 0 forward (0 -   0.0%)


-- 
2.22.1


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

* [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (7 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:34   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The last parameter for the function blk_fill_rwbs() was added in
5782138e47 ("tracing/events: convert block trace points to
TRACE_EVENT()") in order to signal read request and use of that parameter
was replaced with using switch case REQ_OP_READ with
1b9a9ab78b0 ("blktrace: use op accessors"), but the parameter was never
removed.

Remove the unused parameter and adjust the respective call sites.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/linux/blktrace_api.h  |  2 +-
 include/trace/events/bcache.h | 10 +++++-----
 include/trace/events/block.h  | 16 ++++++++--------
 kernel/trace/blktrace.c       |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 05556573b896..11484f1d19a1 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -119,7 +119,7 @@ struct compat_blk_user_trace_setup {
 
 #endif
 
-extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes);
+extern void blk_fill_rwbs(char *rwbs, unsigned int op);
 
 static inline sector_t blk_rq_trace_sector(struct request *rq)
 {
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index e41c611d6d3b..899fdacf57b9 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(bcache_request,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->orig_sector	= bio->bi_iter.bi_sector - 16;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
@@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d  %s %llu + %u",
@@ -137,7 +137,7 @@ TRACE_EVENT(bcache_read,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		__entry->cache_hit = hit;
 		__entry->bypass = bypass;
 	),
@@ -168,7 +168,7 @@ TRACE_EVENT(bcache_write,
 		__entry->inode		= inode;
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		__entry->writeback = writeback;
 		__entry->bypass = bypass;
 	),
@@ -238,7 +238,7 @@ TRACE_EVENT(bcache_journal_write,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
 		__entry->nr_keys	= keys;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d  %s %llu + %u keys %u",
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 0d782663a005..879cba8bdfca 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -89,7 +89,7 @@ TRACE_EVENT(block_rq_requeue,
 		__entry->sector    = blk_rq_trace_sector(rq);
 		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 	),
 
@@ -133,7 +133,7 @@ TRACE_EVENT(block_rq_complete,
 		__entry->nr_sector = nr_bytes >> 9;
 		__entry->error     = error;
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes);
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 	),
 
@@ -166,7 +166,7 @@ DECLARE_EVENT_CLASS(block_rq,
 		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
 		__entry->bytes     = blk_rq_bytes(rq);
 
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 		__get_str(cmd)[0] = '\0';
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
@@ -249,7 +249,7 @@ TRACE_EVENT(block_bio_complete,
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio_sectors(bio);
 		__entry->error		= blk_status_to_errno(bio->bi_status);
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u [%d]",
@@ -276,7 +276,7 @@ DECLARE_EVENT_CLASS(block_bio,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->nr_sector	= bio_sectors(bio);
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
 
@@ -433,7 +433,7 @@ TRACE_EVENT(block_split,
 		__entry->dev		= bio_dev(bio);
 		__entry->sector		= bio->bi_iter.bi_sector;
 		__entry->new_sector	= new_sector;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
 
@@ -474,7 +474,7 @@ TRACE_EVENT(block_bio_remap,
 		__entry->nr_sector	= bio_sectors(bio);
 		__entry->old_dev	= dev;
 		__entry->old_sector	= from;
-		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
+		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
 	),
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
@@ -518,7 +518,7 @@ TRACE_EVENT(block_rq_remap,
 		__entry->old_dev	= dev;
 		__entry->old_sector	= from;
 		__entry->nr_bios	= blk_rq_count_bios(rq);
-		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
+		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
 	),
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 9e9ee4945043..8a2591c7aa41 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1867,7 +1867,7 @@ void blk_trace_remove_sysfs(struct device *dev)
 
 #ifdef CONFIG_EVENT_TRACING
 
-void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes)
+void blk_fill_rwbs(char *rwbs, unsigned int op)
 {
 	int i = 0;
 
-- 
2.22.1


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

* [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (8 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:34   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

blk_fill_rwbs() is an expoted function, add kernel style documentation
comment.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 kernel/trace/blktrace.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 8a2591c7aa41..1a931afcf5c4 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1867,6 +1867,16 @@ void blk_trace_remove_sysfs(struct device *dev)
 
 #ifdef CONFIG_EVENT_TRACING
 
+/**
+ * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string.
+ * @rwbs	buffer to be filled
+ * @op:		REQ_OP_XXX for the tracepoint
+ *
+ * Description:
+ *     Maps the REQ_OP_XXX to character and fills the buffer provided by the
+ *     caller with resulting string.
+ *
+ **/
 void blk_fill_rwbs(char *rwbs, unsigned int op)
 {
 	int i = 0;
-- 
2.22.1


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

* [PATCH 3/7] blktrace: fix blk_rq_issue documentation
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (9 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:34   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The commit 881245dcff29 ("Add DocBook documentation for the block tracepoints.")
added the comment for blk_rq_issue() tracepoint. Remove the duplicate
word from the tracepoint documentation.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/trace/events/block.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 879cba8bdfca..004cfe34ef37 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -196,7 +196,7 @@ DEFINE_EVENT(block_rq, block_rq_insert,
 
 /**
  * block_rq_issue - issue pending block IO request operation to device driver
- * @rq: block IO operation operation request
+ * @rq: block IO operation request
  *
  * Called when block operation request @rq from queue @q is sent to a
  * device driver for processing.
-- 
2.22.1


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

* [PATCH 4/7] blktrace: fix blk_rq_merge documentation
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (10 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:34   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

The commit f3bdc62fd82e ("blktrace: Provide event for request merging")
added the comment for blk_rq_merge() tracepoint. Remove the duplicate
word from the tracepoint documentation.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/trace/events/block.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 004cfe34ef37..cc5ab96a7471 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -210,7 +210,7 @@ DEFINE_EVENT(block_rq, block_rq_issue,
 
 /**
  * block_rq_merge - merge request with another one in the elevator
- * @rq: block IO operation operation request
+ * @rq: block IO operation request
  *
  * Called when block operation request @rq from queue @q is merged to another
  * request queued in the elevator.
-- 
2.22.1


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

* [PATCH 5/7] block: get rid of the trace rq insert wrapper
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (11 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:36   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Get rid of the wrapper for trace_block_rq_insert() and call the function
directly.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/bfq-iosched.c     | 4 +++-
 block/blk-mq-sched.c    | 6 ------
 block/blk-mq-sched.h    | 1 -
 block/kyber-iosched.c   | 4 +++-
 block/mq-deadline.c     | 4 +++-
 kernel/trace/blktrace.c | 1 +
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index dfa87e360d71..da5e1f620625 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -125,6 +125,8 @@
 #include <linux/delay.h>
 #include <linux/backing-dev.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-tag.h"
@@ -5621,7 +5623,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 
 	spin_unlock_irq(&bfqd->lock);
 
-	blk_mq_sched_request_inserted(rq);
+	trace_block_rq_insert(rq);
 
 	spin_lock_irq(&bfqd->lock);
 	bfqq = bfq_init_rq(rq);
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index deff4e826e23..ddb65e9e6fd9 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -384,12 +384,6 @@ bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq)
 }
 EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge);
 
-void blk_mq_sched_request_inserted(struct request *rq)
-{
-	trace_block_rq_insert(rq);
-}
-EXPORT_SYMBOL_GPL(blk_mq_sched_request_inserted);
-
 static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx,
 				       bool has_sched,
 				       struct request *rq)
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index 0476360f05f1..5b18ab915c65 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -7,7 +7,6 @@
 
 void blk_mq_sched_assign_ioc(struct request *rq);
 
-void blk_mq_sched_request_inserted(struct request *rq);
 bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio,
 		unsigned int nr_segs, struct request **merged_request);
 bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index c25c41d0d061..f13da10953bf 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -13,6 +13,8 @@
 #include <linux/module.h>
 #include <linux/sbitmap.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
@@ -602,7 +604,7 @@ static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
 			list_move_tail(&rq->queuelist, head);
 		sbitmap_set_bit(&khd->kcq_map[sched_domain],
 				rq->mq_ctx->index_hw[hctx->type]);
-		blk_mq_sched_request_inserted(rq);
+		trace_block_rq_insert(rq);
 		spin_unlock(&kcq->lock);
 	}
 }
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index b57470e154c8..f3631a287466 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -18,6 +18,8 @@
 #include <linux/rbtree.h>
 #include <linux/sbitmap.h>
 
+#include <trace/events/block.h>
+
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
@@ -496,7 +498,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
 	if (blk_mq_sched_try_insert_merge(q, rq))
 		return;
 
-	blk_mq_sched_request_inserted(rq);
+	trace_block_rq_insert(rq);
 
 	if (at_head || blk_rq_is_passthrough(rq)) {
 		if (at_head)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 1a931afcf5c4..259635217a53 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -852,6 +852,7 @@ static void blk_add_trace_rq_issue(void *ignore, struct request *rq)
 	blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_ISSUE,
 			 blk_trace_request_get_cgid(rq));
 }
+EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_insert);
 
 static void blk_add_trace_rq_merge(void *ignore, struct request *rq)
 {
-- 
2.22.1


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

* [PATCH 6/7] null_blk: allow disacrd on non-membacked mode
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (12 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  9:36   ` Christoph Hellwig
  2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
  2021-02-02  5:29 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
  15 siblings, 1 reply; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

null blk driver supports REQ_OP_DISACRD in membacked mode. When testing
special requests having REQ_OP_DISCARD support is helpful to validate
the special request path when mixed with read-write.

Consider module parameter when setting the queue discard flag when
device is not memory backed.

This is needed to test the tracepoint related to REQ_OP_DISCARD.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
# modprobe  -r null_blk
# gitlog -7 
4ac4d49e1028 (HEAD -> for-next) null_blk: add module param queue bounce limit
468e3617dae8 null_blk: allow disacrd on non-membacked mode
bdc96efe9681 block: get rid of the trace rq insert wrapper
73bf523a7ce4 blktrace: fix blk_rq_merge documentation
6016632555da blktrace: fix blk_rq_issue documentation
58b5d7103a94 blktrace: add blk_fill_rwbs documentation comment
534f321f57dd block: remove superfluous param in blk_fill_rwbs()

Test to exercise module parameter vs configfs discard param, set up
nullb0 such a way that it errors out in both cases for module param
discard :-

for discard in 0 1
do 
	modprobe -r null_blk
	i=0
	echo "Module param discard ${discard}"
	modprobe null_blk nr_devices=0 discard=${discard}
	# Create dev 0 no discard 
	NULLB_DIR=config/nullb/nullb${i}
	mkdir config/nullb/nullb${i}
	echo 1 > config/nullb/nullb${i}/memory_backed
	echo 512 > config/nullb/nullb${i}/blocksize 
	echo 2048 > config/nullb/nullb${i}/size 
	echo 1 > config/nullb/nullb${i}/power
	echo -n "$nullb${i} membacked : ";
	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
	echo -n "$nullb${i} discard   : ";
	cat /sys/kernel/config/nullb/nullb${i}/discard
	# Create dev 1 with discard 
	i=1
	NULLB_DIR=config/nullb/nullb${i}
	mkdir config/nullb/nullb${i}
	echo 1 > config/nullb/nullb${i}/memory_backed
	echo 512 > config/nullb/nullb${i}/blocksize 
	echo 2048 > config/nullb/nullb${i}/size 
	echo 1 > config/nullb/nullb${i}/discard
	echo 1 > config/nullb/nullb${i}/power
	echo -n "$nullb${i} membacked : ";
	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
	echo -n "$nullb${i} discard   : ";
	cat /sys/kernel/config/nullb/nullb${i}/discard

	# should fail 
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	# should pass
	blkdiscard -o 0 -l 1024 /dev/nullb1

	echo 0 > config/nullb/nullb0/power
	echo 0 > config/nullb/nullb1/power
	rmdir config/nullb/nullb*

	modprobe -r null_blk
	modprobe null_blk
	# should fail 
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	modprobe -r null_blk
	modprobe null_blk discard=1
	# should pass
	blkdiscard -o 0 -l 1024 /dev/nullb0 
	modprobe -r null_blk
	echo "--------------------------"
done

modprobe -r null_blk
modprobe null_blk
blkdiscard -o 0 -l 1024 /dev/nullb0 
modprobe -r null_blk
modprobe null_blk discard=1
blkdiscard -o 0 -l 1024 /dev/nullb0 
modprobe -r null_blk

# ./discard_module_param_test.sh 
Module param discard 0
0 membacked : 1
0 discard   : 0
1 membacked : 1
1 discard   : 1
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
--------------------------
Module param discard 1
0 membacked : 1
0 discard   : 0
1 membacked : 1
1 discard   : 1
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
--------------------------
blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
---
 drivers/block/null_blk/main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index d6c821d48090..6e6cbb953a12 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -172,6 +172,10 @@ static bool g_shared_tag_bitmap;
 module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444);
 MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq");
 
+static bool g_discard;
+module_param_named(discard, g_discard, bool, 0444);
+MODULE_PARM_DESC(discard, "Enable queue discard (default: false)");
+
 static int g_irqmode = NULL_IRQ_SOFTIRQ;
 
 static int null_set_irqmode(const char *str, const struct kernel_param *kp)
@@ -1588,14 +1592,11 @@ static void null_del_dev(struct nullb *nullb)
 
 static void null_config_discard(struct nullb *nullb)
 {
-	if (nullb->dev->discard == false)
+	if (nullb->dev->memory_backed && nullb->dev->discard == false)
 		return;
 
-	if (!nullb->dev->memory_backed) {
-		nullb->dev->discard = false;
-		pr_info("discard option is ignored without memory backing\n");
+	if (!nullb->dev->memory_backed && !g_discard)
 		return;
-	}
 
 	if (nullb->dev->zoned) {
 		nullb->dev->discard = false;
-- 
2.22.1


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

* [PATCH 7/7] null_blk: add module param queue bounce limit
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (13 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
@ 2021-02-02  5:25 ` Chaitanya Kulkarni
  2021-02-02  5:29 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
  15 siblings, 0 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:25 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, chaitanya.kulkarni,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

This patch adds a new module parameter to set the queue bounce limit.
Various queue limits parameters are usually present in the sysfs.
This is needed for testing purpose only so instead of poluting the
sysfs space just update the null_blk drivers.

This is needed especially for blktrace bounce related tracepoint
testing.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
# modprobe null_blk bounce_pfn=0x1000
# for bs in 512 1024 2048 4096 8192
> do
> 	dd if=/dev/zero of=/dev/nullb0 bs=${bs} count=1 oflag=direct
> done
# ~/blktrace/blktrace -a write -d /dev/nullb0 -o -| ~/blktrace/blkparse -i -
#
# # With null_blk bounce 
# modprobe null_blk bounce_pfn=0x1000
#
252,0   34        1     0.000000000  4390  Q  WS 0 + 1 [dd]
252,0   34        2     0.000010139  4390  B  WS 0 + 1 [dd]
252,0   34        3     0.000018996  4390  G  WS 0 + 1 [dd]
252,0   34        4     0.000024576  4390  I  WS 0 + 1 [dd]
252,0   34        5     0.000065152   829  D  WS 0 + 1 [kworker/34:1H]
252,0   34        6     0.000092303   182  C  WS 0 + 1 [0]
252,0   34        7     0.000098164   182  C  WS 0 + 1 [0]
252,0   27        1     0.004573597  4391  Q  WS 0 + 2 [dd]
252,0   27        2     0.004580891  4391  B  WS 0 + 2 [dd]
252,0   27        3     0.004589687  4391  G  WS 0 + 2 [dd]
252,0   27        4     0.004594356  4391  I  WS 0 + 2 [dd]
252,0   27        5     0.004619473  1049  D  WS 0 + 2 [kworker/27:1H]
252,0   27        6     0.004634411   147  C  WS 0 + 2 [0]
252,0   27        7     0.004638609   147  C  WS 0 + 2 [0]
252,0   29        1     0.014589610  4394  Q  WS 0 + 8 [dd]
252,0   29        2     0.014595792  4394  B  WS 0 + 8 [dd]
252,0   29        3     0.014599028  4394  G  WS 0 + 8 [dd]
252,0   29        4     0.014601713  4394  I  WS 0 + 8 [dd]
252,0   29        5     0.014621330   807  D  WS 0 + 8 [kworker/29:1H]
252,0   29        6     0.014633813   157  C  WS 0 + 8 [0]
252,0   29        7     0.014637660   157  C  WS 0 + 8 [0]
252,0   30        1     0.009147174  4392  Q  WS 0 + 4 [dd]
252,0   30        2     0.009154377  4392  B  WS 0 + 4 [dd]
252,0   30        3     0.009163064  4392  G  WS 0 + 4 [dd]
252,0   30        4     0.009167161  4392  I  WS 0 + 4 [dd]
252,0   30        5     0.009191437  1084  D  WS 0 + 4 [kworker/30:1H]
252,0   30        6     0.009206084   162  C  WS 0 + 4 [0]
252,0   30        7     0.009210863   162  C  WS 0 + 4 [0]
252,0   30        8     0.018510473  4395  Q  WS 0 + 16 [dd]
252,0   30        9     0.018517767  4395  B  WS 0 + 16 [dd]
252,0   30       10     0.018521213  4395  G  WS 0 + 16 [dd]
252,0   30       11     0.018524229  4395  I  WS 0 + 16 [dd]
252,0   30       12     0.018544026  1084  D  WS 0 + 16 [kworker/30:1H]
252,0   30       13     0.018555127   162  C  WS 0 + 16 [0]
252,0   30       14     0.018558333   162  C  WS 0 + 16 [0]

# # Without null_blk bounce 
252,0   38        1     0.000000000  4744  Q  WS 0 + 1 [dd]
252,0   38        2     0.000014768  4744  G  WS 0 + 1 [dd]
252,0   38        3     0.000021771  4744  I  WS 0 + 1 [dd]
252,0   38        4     0.000062557   914  D  WS 0 + 1 [kworker/38:1H]
252,0   38        5     0.000089768   202  C  WS 0 + 1 [0]
252,0   32        1     0.018453947  4749  Q  WS 0 + 16 [dd]
252,0   32        2     0.018466080  4749  G  WS 0 + 16 [dd]
252,0   32        3     0.018470619  4749  I  WS 0 + 16 [dd]
252,0   32        4     0.018495195   514  D  WS 0 + 16 [kworker/32:1H]
252,0   32        5     0.018509942   172  C  WS 0 + 16 [0]
252,0   55        1     0.005000087  4745  Q  WS 0 + 2 [dd]
252,0   55        2     0.005005637  4745  G  WS 0 + 2 [dd]
252,0   55        3     0.005008453  4745  I  WS 0 + 2 [dd]
252,0   55        4     0.005029352  1082  D  WS 0 + 2 [kworker/55:1H]
252,0   55        5     0.005041915   287  C  WS 0 + 2 [0]
252,0   31        1     0.014158231  4748  Q  WS 0 + 8 [dd]
252,0   31        2     0.014164173  4748  G  WS 0 + 8 [dd]
252,0   31        3     0.014167308  4748  I  WS 0 + 8 [dd]
252,0   31        4     0.014188759  1151  D  WS 0 + 8 [kworker/31:1H]
252,0   31        5     0.014203015   167  C  WS 0 + 8 [0]
252,0   58        1     0.010016655  4747  D  WS 0 + 4 [systemd-udevd]
252,0   60        1     0.009982571  4746  Q  WS 0 + 4 [dd]
252,0   60        2     0.009993942  4746  G  WS 0 + 4 [dd]
252,0   60        3     0.009998661  4746  I  WS 0 + 4 [dd]
252,0   60        4     0.010136269     0  C  WS 0 + 4 [0]

---
 drivers/block/null_blk/main.c     | 20 +++++++++++++++++++-
 drivers/block/null_blk/null_blk.h |  1 +
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 6e6cbb953a12..8ddf2ba961f7 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -156,6 +156,10 @@ static int g_max_sectors;
 module_param_named(max_sectors, g_max_sectors, int, 0444);
 MODULE_PARM_DESC(max_sectors, "Maximum size of a command (in 512B sectors)");
 
+static unsigned int g_bounce_pfn;
+module_param_named(bounce_pfn, g_bounce_pfn, int, 0444);
+MODULE_PARM_DESC(bounce_pfn, "Queue Bounce limit (default: 0)");
+
 static unsigned int nr_devices = 1;
 module_param(nr_devices, uint, 0444);
 MODULE_PARM_DESC(nr_devices, "Number of devices to register");
@@ -354,6 +358,7 @@ NULLB_DEVICE_ATTR(submit_queues, uint, nullb_apply_submit_queues);
 NULLB_DEVICE_ATTR(home_node, uint, NULL);
 NULLB_DEVICE_ATTR(queue_mode, uint, NULL);
 NULLB_DEVICE_ATTR(blocksize, uint, NULL);
+NULLB_DEVICE_ATTR(bounce_pfn, uint, NULL);
 NULLB_DEVICE_ATTR(max_sectors, uint, NULL);
 NULLB_DEVICE_ATTR(irqmode, uint, NULL);
 NULLB_DEVICE_ATTR(hw_queue_depth, uint, NULL);
@@ -472,6 +477,7 @@ static struct configfs_attribute *nullb_device_attrs[] = {
 	&nullb_device_attr_home_node,
 	&nullb_device_attr_queue_mode,
 	&nullb_device_attr_blocksize,
+	&nullb_device_attr_bounce_pfn,
 	&nullb_device_attr_max_sectors,
 	&nullb_device_attr_irqmode,
 	&nullb_device_attr_hw_queue_depth,
@@ -543,7 +549,7 @@ nullb_group_drop_item(struct config_group *group, struct config_item *item)
 static ssize_t memb_group_features_show(struct config_item *item, char *page)
 {
 	return snprintf(page, PAGE_SIZE,
-			"memory_backed,discard,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv,zone_max_open,zone_max_active,blocksize,max_sectors\n");
+			"memory_backed,discard,bounce_pfn,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv\n");
 }
 
 CONFIGFS_ATTR_RO(memb_group_, features);
@@ -1610,6 +1616,17 @@ static void null_config_discard(struct nullb *nullb)
 	blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q);
 }
 
+static void null_config_bounce_pfn(struct nullb *nullb)
+{
+	if (nullb->dev->memory_backed && nullb->dev->bounce_pfn == false)
+		return;
+
+	if (!nullb->dev->memory_backed && !g_bounce_pfn)
+		return;
+
+	blk_queue_bounce_limit(nullb->q, nullb->dev->bounce_pfn);
+}
+
 static const struct block_device_operations null_bio_ops = {
 	.owner		= THIS_MODULE,
 	.submit_bio	= null_submit_bio,
@@ -1882,6 +1899,7 @@ static int null_add_dev(struct nullb_device *dev)
 	blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
 
 	null_config_discard(nullb);
+	null_config_bounce_pfn(nullb);
 
 	sprintf(nullb->disk_name, "nullb%d", nullb->index);
 
diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h
index 83504f3cc9d6..cd55f99118bf 100644
--- a/drivers/block/null_blk/null_blk.h
+++ b/drivers/block/null_blk/null_blk.h
@@ -86,6 +86,7 @@ struct nullb_device {
 	unsigned int queue_mode; /* block interface */
 	unsigned int blocksize; /* block size */
 	unsigned int max_sectors; /* Max sectors per command */
+	unsigned int bounce_pfn; /* bounce page frame number */
 	unsigned int irqmode; /* IRQ completion handler */
 	unsigned int hw_queue_depth; /* queue depth */
 	unsigned int index; /* index of the disk, only valid with a disk */
-- 
2.22.1


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

* Re: [PATCH 0/7] blktrace: few clenaup
  2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
                   ` (14 preceding siblings ...)
  2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
@ 2021-02-02  5:29 ` Chaitanya Kulkarni
  15 siblings, 0 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02  5:29 UTC (permalink / raw)
  To: linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	Damien Le Moal, bvanassche, dongli.zhang, akpm, Aravind Ramesh,
	joshi.k, Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2/1/21 21:25, Chaitanya Kulkarni wrote:
> Hi,
>
> These are few cleanups for the block trace.
>
> Below is the test log on latest linux-block/for-next.
>
> Last two patches are needed to for testing.
>
> -ck
Looks like this series got sent out twice, please ignore the first one.

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

* Re: [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
@ 2021-02-02  9:02   ` Damien Le Moal
  2021-02-02  9:04   ` Damien Le Moal
  2021-02-02  9:55   ` Johannes Thumshirn
  2 siblings, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:02 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> The last parameter for the function blk_fill_rwbs() was added in
> 5782138e47 ("tracing/events: convert block trace points to
> TRACE_EVENT()") in order to signal read request and use of that parameter
> was replaced with using switch case REQ_OP_READ with
> 1b9a9ab78b0 ("blktrace: use op accessors"), but the parameter was never
> removed.
> 
> Remove the unused parameter and adjust the respective call sites.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  include/linux/blktrace_api.h  |  2 +-
>  include/trace/events/bcache.h | 10 +++++-----
>  include/trace/events/block.h  | 16 ++++++++--------
>  kernel/trace/blktrace.c       |  2 +-
>  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
> index 05556573b896..11484f1d19a1 100644
> --- a/include/linux/blktrace_api.h
> +++ b/include/linux/blktrace_api.h
> @@ -119,7 +119,7 @@ struct compat_blk_user_trace_setup {
>  
>  #endif
>  
> -extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes);
> +extern void blk_fill_rwbs(char *rwbs, unsigned int op);
>  
>  static inline sector_t blk_rq_trace_sector(struct request *rq)
>  {
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index e41c611d6d3b..899fdacf57b9 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(bcache_request,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->orig_sector	= bio->bi_iter.bi_sector - 16;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
> @@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d  %s %llu + %u",
> @@ -137,7 +137,7 @@ TRACE_EVENT(bcache_read,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		__entry->cache_hit = hit;
>  		__entry->bypass = bypass;
>  	),
> @@ -168,7 +168,7 @@ TRACE_EVENT(bcache_write,
>  		__entry->inode		= inode;
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		__entry->writeback = writeback;
>  		__entry->bypass = bypass;
>  	),
> @@ -238,7 +238,7 @@ TRACE_EVENT(bcache_journal_write,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
>  		__entry->nr_keys	= keys;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d  %s %llu + %u keys %u",
> diff --git a/include/trace/events/block.h b/include/trace/events/block.h
> index 0d782663a005..879cba8bdfca 100644
> --- a/include/trace/events/block.h
> +++ b/include/trace/events/block.h
> @@ -89,7 +89,7 @@ TRACE_EVENT(block_rq_requeue,
>  		__entry->sector    = blk_rq_trace_sector(rq);
>  		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  	),
>  
> @@ -133,7 +133,7 @@ TRACE_EVENT(block_rq_complete,
>  		__entry->nr_sector = nr_bytes >> 9;
>  		__entry->error     = error;
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes);
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  	),
>  
> @@ -166,7 +166,7 @@ DECLARE_EVENT_CLASS(block_rq,
>  		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
>  		__entry->bytes     = blk_rq_bytes(rq);
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
> @@ -249,7 +249,7 @@ TRACE_EVENT(block_bio_complete,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio_sectors(bio);
>  		__entry->error		= blk_status_to_errno(bio->bi_status);
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u [%d]",
> @@ -276,7 +276,7 @@ DECLARE_EVENT_CLASS(block_bio,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio_sectors(bio);
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
>  
> @@ -433,7 +433,7 @@ TRACE_EVENT(block_split,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->new_sector	= new_sector;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
>  
> @@ -474,7 +474,7 @@ TRACE_EVENT(block_bio_remap,
>  		__entry->nr_sector	= bio_sectors(bio);
>  		__entry->old_dev	= dev;
>  		__entry->old_sector	= from;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
> @@ -518,7 +518,7 @@ TRACE_EVENT(block_rq_remap,
>  		__entry->old_dev	= dev;
>  		__entry->old_sector	= from;
>  		__entry->nr_bios	= blk_rq_count_bios(rq);
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index 9e9ee4945043..8a2591c7aa41 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -1867,7 +1867,7 @@ void blk_trace_remove_sysfs(struct device *dev)
>  
>  #ifdef CONFIG_EVENT_TRACING
>  
> -void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes)
> +void blk_fill_rwbs(char *rwbs, unsigned int op)
>  {
>  	int i = 0;
>  
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
@ 2021-02-02  9:03   ` Damien Le Moal
  2021-02-02  9:55   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:03 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> blk_fill_rwbs() is an expoted function, add kernel style documentation
> comment.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  kernel/trace/blktrace.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index 8a2591c7aa41..1a931afcf5c4 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -1867,6 +1867,16 @@ void blk_trace_remove_sysfs(struct device *dev)
>  
>  #ifdef CONFIG_EVENT_TRACING
>  
> +/**
> + * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string.
> + * @rwbs	buffer to be filled
> + * @op:		REQ_OP_XXX for the tracepoint
> + *
> + * Description:
> + *     Maps the REQ_OP_XXX to character and fills the buffer provided by the
> + *     caller with resulting string.
> + *
> + **/
>  void blk_fill_rwbs(char *rwbs, unsigned int op)
>  {
>  	int i = 0;
> 

The description is a little redundant: the short description is enough I think.
But OK.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 3/7] blktrace: fix blk_rq_issue documentation
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
@ 2021-02-02  9:04   ` Damien Le Moal
  2021-02-02  9:56   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:04 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> The commit 881245dcff29 ("Add DocBook documentation for the block tracepoints.")
> added the comment for blk_rq_issue() tracepoint. Remove the duplicate
> word from the tracepoint documentation.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Fixes tag ?

> ---
>  include/trace/events/block.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/block.h b/include/trace/events/block.h
> index 879cba8bdfca..004cfe34ef37 100644
> --- a/include/trace/events/block.h
> +++ b/include/trace/events/block.h
> @@ -196,7 +196,7 @@ DEFINE_EVENT(block_rq, block_rq_insert,
>  
>  /**
>   * block_rq_issue - issue pending block IO request operation to device driver
> - * @rq: block IO operation operation request
> + * @rq: block IO operation request
>   *
>   * Called when block operation request @rq from queue @q is sent to a
>   * device driver for processing.
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
  2021-02-02  9:02   ` Damien Le Moal
@ 2021-02-02  9:04   ` Damien Le Moal
  2021-02-02  9:55   ` Johannes Thumshirn
  2 siblings, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:04 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> The last parameter for the function blk_fill_rwbs() was added in
> 5782138e47 ("tracing/events: convert block trace points to
> TRACE_EVENT()") in order to signal read request and use of that parameter
> was replaced with using switch case REQ_OP_READ with
> 1b9a9ab78b0 ("blktrace: use op accessors"), but the parameter was never
> removed.
> 
> Remove the unused parameter and adjust the respective call sites.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Fixes tag ?

> ---
>  include/linux/blktrace_api.h  |  2 +-
>  include/trace/events/bcache.h | 10 +++++-----
>  include/trace/events/block.h  | 16 ++++++++--------
>  kernel/trace/blktrace.c       |  2 +-
>  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
> index 05556573b896..11484f1d19a1 100644
> --- a/include/linux/blktrace_api.h
> +++ b/include/linux/blktrace_api.h
> @@ -119,7 +119,7 @@ struct compat_blk_user_trace_setup {
>  
>  #endif
>  
> -extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes);
> +extern void blk_fill_rwbs(char *rwbs, unsigned int op);
>  
>  static inline sector_t blk_rq_trace_sector(struct request *rq)
>  {
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index e41c611d6d3b..899fdacf57b9 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(bcache_request,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->orig_sector	= bio->bi_iter.bi_sector - 16;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
> @@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d  %s %llu + %u",
> @@ -137,7 +137,7 @@ TRACE_EVENT(bcache_read,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		__entry->cache_hit = hit;
>  		__entry->bypass = bypass;
>  	),
> @@ -168,7 +168,7 @@ TRACE_EVENT(bcache_write,
>  		__entry->inode		= inode;
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		__entry->writeback = writeback;
>  		__entry->bypass = bypass;
>  	),
> @@ -238,7 +238,7 @@ TRACE_EVENT(bcache_journal_write,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio->bi_iter.bi_size >> 9;
>  		__entry->nr_keys	= keys;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d  %s %llu + %u keys %u",
> diff --git a/include/trace/events/block.h b/include/trace/events/block.h
> index 0d782663a005..879cba8bdfca 100644
> --- a/include/trace/events/block.h
> +++ b/include/trace/events/block.h
> @@ -89,7 +89,7 @@ TRACE_EVENT(block_rq_requeue,
>  		__entry->sector    = blk_rq_trace_sector(rq);
>  		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  	),
>  
> @@ -133,7 +133,7 @@ TRACE_EVENT(block_rq_complete,
>  		__entry->nr_sector = nr_bytes >> 9;
>  		__entry->error     = error;
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes);
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  	),
>  
> @@ -166,7 +166,7 @@ DECLARE_EVENT_CLASS(block_rq,
>  		__entry->nr_sector = blk_rq_trace_nr_sectors(rq);
>  		__entry->bytes     = blk_rq_bytes(rq);
>  
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  		__get_str(cmd)[0] = '\0';
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
> @@ -249,7 +249,7 @@ TRACE_EVENT(block_bio_complete,
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio_sectors(bio);
>  		__entry->error		= blk_status_to_errno(bio->bi_status);
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u [%d]",
> @@ -276,7 +276,7 @@ DECLARE_EVENT_CLASS(block_bio,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->nr_sector	= bio_sectors(bio);
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
>  
> @@ -433,7 +433,7 @@ TRACE_EVENT(block_split,
>  		__entry->dev		= bio_dev(bio);
>  		__entry->sector		= bio->bi_iter.bi_sector;
>  		__entry->new_sector	= new_sector;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
>  	),
>  
> @@ -474,7 +474,7 @@ TRACE_EVENT(block_bio_remap,
>  		__entry->nr_sector	= bio_sectors(bio);
>  		__entry->old_dev	= dev;
>  		__entry->old_sector	= from;
> -		blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size);
> +		blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
> @@ -518,7 +518,7 @@ TRACE_EVENT(block_rq_remap,
>  		__entry->old_dev	= dev;
>  		__entry->old_sector	= from;
>  		__entry->nr_bios	= blk_rq_count_bios(rq);
> -		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
> +		blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
>  	),
>  
>  	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index 9e9ee4945043..8a2591c7aa41 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -1867,7 +1867,7 @@ void blk_trace_remove_sysfs(struct device *dev)
>  
>  #ifdef CONFIG_EVENT_TRACING
>  
> -void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes)
> +void blk_fill_rwbs(char *rwbs, unsigned int op)
>  {
>  	int i = 0;
>  
> 


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 4/7] blktrace: fix blk_rq_merge documentation
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
@ 2021-02-02  9:05   ` Damien Le Moal
  2021-02-02  9:57   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:05 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> The commit f3bdc62fd82e ("blktrace: Provide event for request merging")
> added the comment for blk_rq_merge() tracepoint. Remove the duplicate
> word from the tracepoint documentation.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Fixes tag ?

> ---
>  include/trace/events/block.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/block.h b/include/trace/events/block.h
> index 004cfe34ef37..cc5ab96a7471 100644
> --- a/include/trace/events/block.h
> +++ b/include/trace/events/block.h
> @@ -210,7 +210,7 @@ DEFINE_EVENT(block_rq, block_rq_issue,
>  
>  /**
>   * block_rq_merge - merge request with another one in the elevator
> - * @rq: block IO operation operation request
> + * @rq: block IO operation request
>   *
>   * Called when block operation request @rq from queue @q is merged to another
>   * request queued in the elevator.
> 

Otherwise looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 5/7] block: get rid of the trace rq insert wrapper
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
@ 2021-02-02  9:05   ` Damien Le Moal
  2021-02-02  9:58   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:05 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> Get rid of the wrapper for trace_block_rq_insert() and call the function
> directly.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  block/bfq-iosched.c     | 4 +++-
>  block/blk-mq-sched.c    | 6 ------
>  block/blk-mq-sched.h    | 1 -
>  block/kyber-iosched.c   | 4 +++-
>  block/mq-deadline.c     | 4 +++-
>  kernel/trace/blktrace.c | 1 +
>  6 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index dfa87e360d71..da5e1f620625 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -125,6 +125,8 @@
>  #include <linux/delay.h>
>  #include <linux/backing-dev.h>
>  
> +#include <trace/events/block.h>
> +
>  #include "blk.h"
>  #include "blk-mq.h"
>  #include "blk-mq-tag.h"
> @@ -5621,7 +5623,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  
>  	spin_unlock_irq(&bfqd->lock);
>  
> -	blk_mq_sched_request_inserted(rq);
> +	trace_block_rq_insert(rq);
>  
>  	spin_lock_irq(&bfqd->lock);
>  	bfqq = bfq_init_rq(rq);
> diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
> index deff4e826e23..ddb65e9e6fd9 100644
> --- a/block/blk-mq-sched.c
> +++ b/block/blk-mq-sched.c
> @@ -384,12 +384,6 @@ bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq)
>  }
>  EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge);
>  
> -void blk_mq_sched_request_inserted(struct request *rq)
> -{
> -	trace_block_rq_insert(rq);
> -}
> -EXPORT_SYMBOL_GPL(blk_mq_sched_request_inserted);
> -
>  static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx,
>  				       bool has_sched,
>  				       struct request *rq)
> diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
> index 0476360f05f1..5b18ab915c65 100644
> --- a/block/blk-mq-sched.h
> +++ b/block/blk-mq-sched.h
> @@ -7,7 +7,6 @@
>  
>  void blk_mq_sched_assign_ioc(struct request *rq);
>  
> -void blk_mq_sched_request_inserted(struct request *rq);
>  bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio,
>  		unsigned int nr_segs, struct request **merged_request);
>  bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
> diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
> index c25c41d0d061..f13da10953bf 100644
> --- a/block/kyber-iosched.c
> +++ b/block/kyber-iosched.c
> @@ -13,6 +13,8 @@
>  #include <linux/module.h>
>  #include <linux/sbitmap.h>
>  
> +#include <trace/events/block.h>
> +
>  #include "blk.h"
>  #include "blk-mq.h"
>  #include "blk-mq-debugfs.h"
> @@ -602,7 +604,7 @@ static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
>  			list_move_tail(&rq->queuelist, head);
>  		sbitmap_set_bit(&khd->kcq_map[sched_domain],
>  				rq->mq_ctx->index_hw[hctx->type]);
> -		blk_mq_sched_request_inserted(rq);
> +		trace_block_rq_insert(rq);
>  		spin_unlock(&kcq->lock);
>  	}
>  }
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index b57470e154c8..f3631a287466 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -18,6 +18,8 @@
>  #include <linux/rbtree.h>
>  #include <linux/sbitmap.h>
>  
> +#include <trace/events/block.h>
> +
>  #include "blk.h"
>  #include "blk-mq.h"
>  #include "blk-mq-debugfs.h"
> @@ -496,7 +498,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>  	if (blk_mq_sched_try_insert_merge(q, rq))
>  		return;
>  
> -	blk_mq_sched_request_inserted(rq);
> +	trace_block_rq_insert(rq);
>  
>  	if (at_head || blk_rq_is_passthrough(rq)) {
>  		if (at_head)
> diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> index 1a931afcf5c4..259635217a53 100644
> --- a/kernel/trace/blktrace.c
> +++ b/kernel/trace/blktrace.c
> @@ -852,6 +852,7 @@ static void blk_add_trace_rq_issue(void *ignore, struct request *rq)
>  	blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_ISSUE,
>  			 blk_trace_request_get_cgid(rq));
>  }
> +EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_insert);
>  
>  static void blk_add_trace_rq_merge(void *ignore, struct request *rq)
>  {
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 6/7] null_blk: allow disacrd on non-membacked mode
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
@ 2021-02-02  9:08   ` Damien Le Moal
  0 siblings, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:08 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

Typo in the patch title.


On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> null blk driver supports REQ_OP_DISACRD in membacked mode. When testing
> special requests having REQ_OP_DISCARD support is helpful to validate
> the special request path when mixed with read-write.
> 
> Consider module parameter when setting the queue discard flag when
> device is not memory backed.
> 
> This is needed to test the tracepoint related to REQ_OP_DISCARD.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> # modprobe  -r null_blk
> # gitlog -7 
> 4ac4d49e1028 (HEAD -> for-next) null_blk: add module param queue bounce limit
> 468e3617dae8 null_blk: allow disacrd on non-membacked mode
> bdc96efe9681 block: get rid of the trace rq insert wrapper
> 73bf523a7ce4 blktrace: fix blk_rq_merge documentation
> 6016632555da blktrace: fix blk_rq_issue documentation
> 58b5d7103a94 blktrace: add blk_fill_rwbs documentation comment
> 534f321f57dd block: remove superfluous param in blk_fill_rwbs()
> 
> Test to exercise module parameter vs configfs discard param, set up
> nullb0 such a way that it errors out in both cases for module param
> discard :-
> 
> for discard in 0 1
> do 
> 	modprobe -r null_blk
> 	i=0
> 	echo "Module param discard ${discard}"
> 	modprobe null_blk nr_devices=0 discard=${discard}
> 	# Create dev 0 no discard 
> 	NULLB_DIR=config/nullb/nullb${i}
> 	mkdir config/nullb/nullb${i}
> 	echo 1 > config/nullb/nullb${i}/memory_backed
> 	echo 512 > config/nullb/nullb${i}/blocksize 
> 	echo 2048 > config/nullb/nullb${i}/size 
> 	echo 1 > config/nullb/nullb${i}/power
> 	echo -n "$nullb${i} membacked : ";
> 	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
> 	echo -n "$nullb${i} discard   : ";
> 	cat /sys/kernel/config/nullb/nullb${i}/discard
> 	# Create dev 1 with discard 
> 	i=1
> 	NULLB_DIR=config/nullb/nullb${i}
> 	mkdir config/nullb/nullb${i}
> 	echo 1 > config/nullb/nullb${i}/memory_backed
> 	echo 512 > config/nullb/nullb${i}/blocksize 
> 	echo 2048 > config/nullb/nullb${i}/size 
> 	echo 1 > config/nullb/nullb${i}/discard
> 	echo 1 > config/nullb/nullb${i}/power
> 	echo -n "$nullb${i} membacked : ";
> 	cat /sys/kernel/config/nullb/nullb${i}/memory_backed 
> 	echo -n "$nullb${i} discard   : ";
> 	cat /sys/kernel/config/nullb/nullb${i}/discard
> 
> 	# should fail 
> 	blkdiscard -o 0 -l 1024 /dev/nullb0 
> 	# should pass
> 	blkdiscard -o 0 -l 1024 /dev/nullb1
> 
> 	echo 0 > config/nullb/nullb0/power
> 	echo 0 > config/nullb/nullb1/power
> 	rmdir config/nullb/nullb*
> 
> 	modprobe -r null_blk
> 	modprobe null_blk
> 	# should fail 
> 	blkdiscard -o 0 -l 1024 /dev/nullb0 
> 	modprobe -r null_blk
> 	modprobe null_blk discard=1
> 	# should pass
> 	blkdiscard -o 0 -l 1024 /dev/nullb0 
> 	modprobe -r null_blk
> 	echo "--------------------------"
> done
> 
> modprobe -r null_blk
> modprobe null_blk
> blkdiscard -o 0 -l 1024 /dev/nullb0 
> modprobe -r null_blk
> modprobe null_blk discard=1
> blkdiscard -o 0 -l 1024 /dev/nullb0 
> modprobe -r null_blk
> 
> # ./discard_module_param_test.sh 
> Module param discard 0
> 0 membacked : 1
> 0 discard   : 0
> 1 membacked : 1
> 1 discard   : 1
> blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
> blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
> --------------------------
> Module param discard 1
> 0 membacked : 1
> 0 discard   : 0
> 1 membacked : 1
> 1 discard   : 1
> blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
> blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
> --------------------------
> blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported
> ---
>  drivers/block/null_blk/main.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index d6c821d48090..6e6cbb953a12 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -172,6 +172,10 @@ static bool g_shared_tag_bitmap;
>  module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444);
>  MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq");
>  
> +static bool g_discard;
> +module_param_named(discard, g_discard, bool, 0444);
> +MODULE_PARM_DESC(discard, "Enable queue discard (default: false)");
> +
>  static int g_irqmode = NULL_IRQ_SOFTIRQ;
>  
>  static int null_set_irqmode(const char *str, const struct kernel_param *kp)
> @@ -1588,14 +1592,11 @@ static void null_del_dev(struct nullb *nullb)
>  
>  static void null_config_discard(struct nullb *nullb)
>  {
> -	if (nullb->dev->discard == false)
> +	if (nullb->dev->memory_backed && nullb->dev->discard == false)

What is the point of adding nullb->dev->memory_backed  to the test ? If
nullb->dev->memory_backed is true, nullb->dev->discard should be forced to true
also to retain the behavior we had until now.

>  		return;
>  
> -	if (!nullb->dev->memory_backed) {
> -		nullb->dev->discard = false;
> -		pr_info("discard option is ignored without memory backing\n");
> +	if (!nullb->dev->memory_backed && !g_discard)

I do not understand this one either. Why look at g_discard ?

>  		return;
> -	}
>  
>  	if (nullb->dev->zoned) {
>  		nullb->dev->discard = false;
> 


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 7/7] null_blk: add module param queue bounce limit
  2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
@ 2021-02-02  9:18   ` Damien Le Moal
  0 siblings, 0 replies; 37+ messages in thread
From: Damien Le Moal @ 2021-02-02  9:18 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Johannes Thumshirn,
	bvanassche, dongli.zhang, akpm, Aravind Ramesh, joshi.k,
	Niklas Cassel, hare, colyli, tj, rdunlap, jack, hch

On 2021/02/02 14:26, Chaitanya Kulkarni wrote:
> This patch adds a new module parameter to set the queue bounce limit.
> Various queue limits parameters are usually present in the sysfs.
> This is needed for testing purpose only so instead of poluting the
> sysfs space just update the null_blk drivers.
> 
> This is needed especially for blktrace bounce related tracepoint
> testing.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
> # modprobe null_blk bounce_pfn=0x1000
> # for bs in 512 1024 2048 4096 8192
>> do
>> 	dd if=/dev/zero of=/dev/nullb0 bs=${bs} count=1 oflag=direct
>> done
> # ~/blktrace/blktrace -a write -d /dev/nullb0 -o -| ~/blktrace/blkparse -i -
> #
> # # With null_blk bounce 
> # modprobe null_blk bounce_pfn=0x1000
> #
> 252,0   34        1     0.000000000  4390  Q  WS 0 + 1 [dd]
> 252,0   34        2     0.000010139  4390  B  WS 0 + 1 [dd]
> 252,0   34        3     0.000018996  4390  G  WS 0 + 1 [dd]
> 252,0   34        4     0.000024576  4390  I  WS 0 + 1 [dd]
> 252,0   34        5     0.000065152   829  D  WS 0 + 1 [kworker/34:1H]
> 252,0   34        6     0.000092303   182  C  WS 0 + 1 [0]
> 252,0   34        7     0.000098164   182  C  WS 0 + 1 [0]
> 252,0   27        1     0.004573597  4391  Q  WS 0 + 2 [dd]
> 252,0   27        2     0.004580891  4391  B  WS 0 + 2 [dd]
> 252,0   27        3     0.004589687  4391  G  WS 0 + 2 [dd]
> 252,0   27        4     0.004594356  4391  I  WS 0 + 2 [dd]
> 252,0   27        5     0.004619473  1049  D  WS 0 + 2 [kworker/27:1H]
> 252,0   27        6     0.004634411   147  C  WS 0 + 2 [0]
> 252,0   27        7     0.004638609   147  C  WS 0 + 2 [0]
> 252,0   29        1     0.014589610  4394  Q  WS 0 + 8 [dd]
> 252,0   29        2     0.014595792  4394  B  WS 0 + 8 [dd]
> 252,0   29        3     0.014599028  4394  G  WS 0 + 8 [dd]
> 252,0   29        4     0.014601713  4394  I  WS 0 + 8 [dd]
> 252,0   29        5     0.014621330   807  D  WS 0 + 8 [kworker/29:1H]
> 252,0   29        6     0.014633813   157  C  WS 0 + 8 [0]
> 252,0   29        7     0.014637660   157  C  WS 0 + 8 [0]
> 252,0   30        1     0.009147174  4392  Q  WS 0 + 4 [dd]
> 252,0   30        2     0.009154377  4392  B  WS 0 + 4 [dd]
> 252,0   30        3     0.009163064  4392  G  WS 0 + 4 [dd]
> 252,0   30        4     0.009167161  4392  I  WS 0 + 4 [dd]
> 252,0   30        5     0.009191437  1084  D  WS 0 + 4 [kworker/30:1H]
> 252,0   30        6     0.009206084   162  C  WS 0 + 4 [0]
> 252,0   30        7     0.009210863   162  C  WS 0 + 4 [0]
> 252,0   30        8     0.018510473  4395  Q  WS 0 + 16 [dd]
> 252,0   30        9     0.018517767  4395  B  WS 0 + 16 [dd]
> 252,0   30       10     0.018521213  4395  G  WS 0 + 16 [dd]
> 252,0   30       11     0.018524229  4395  I  WS 0 + 16 [dd]
> 252,0   30       12     0.018544026  1084  D  WS 0 + 16 [kworker/30:1H]
> 252,0   30       13     0.018555127   162  C  WS 0 + 16 [0]
> 252,0   30       14     0.018558333   162  C  WS 0 + 16 [0]
> 
> # # Without null_blk bounce 
> 252,0   38        1     0.000000000  4744  Q  WS 0 + 1 [dd]
> 252,0   38        2     0.000014768  4744  G  WS 0 + 1 [dd]
> 252,0   38        3     0.000021771  4744  I  WS 0 + 1 [dd]
> 252,0   38        4     0.000062557   914  D  WS 0 + 1 [kworker/38:1H]
> 252,0   38        5     0.000089768   202  C  WS 0 + 1 [0]
> 252,0   32        1     0.018453947  4749  Q  WS 0 + 16 [dd]
> 252,0   32        2     0.018466080  4749  G  WS 0 + 16 [dd]
> 252,0   32        3     0.018470619  4749  I  WS 0 + 16 [dd]
> 252,0   32        4     0.018495195   514  D  WS 0 + 16 [kworker/32:1H]
> 252,0   32        5     0.018509942   172  C  WS 0 + 16 [0]
> 252,0   55        1     0.005000087  4745  Q  WS 0 + 2 [dd]
> 252,0   55        2     0.005005637  4745  G  WS 0 + 2 [dd]
> 252,0   55        3     0.005008453  4745  I  WS 0 + 2 [dd]
> 252,0   55        4     0.005029352  1082  D  WS 0 + 2 [kworker/55:1H]
> 252,0   55        5     0.005041915   287  C  WS 0 + 2 [0]
> 252,0   31        1     0.014158231  4748  Q  WS 0 + 8 [dd]
> 252,0   31        2     0.014164173  4748  G  WS 0 + 8 [dd]
> 252,0   31        3     0.014167308  4748  I  WS 0 + 8 [dd]
> 252,0   31        4     0.014188759  1151  D  WS 0 + 8 [kworker/31:1H]
> 252,0   31        5     0.014203015   167  C  WS 0 + 8 [0]
> 252,0   58        1     0.010016655  4747  D  WS 0 + 4 [systemd-udevd]
> 252,0   60        1     0.009982571  4746  Q  WS 0 + 4 [dd]
> 252,0   60        2     0.009993942  4746  G  WS 0 + 4 [dd]
> 252,0   60        3     0.009998661  4746  I  WS 0 + 4 [dd]
> 252,0   60        4     0.010136269     0  C  WS 0 + 4 [0]
> 
> ---
>  drivers/block/null_blk/main.c     | 20 +++++++++++++++++++-
>  drivers/block/null_blk/null_blk.h |  1 +
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index 6e6cbb953a12..8ddf2ba961f7 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -156,6 +156,10 @@ static int g_max_sectors;
>  module_param_named(max_sectors, g_max_sectors, int, 0444);
>  MODULE_PARM_DESC(max_sectors, "Maximum size of a command (in 512B sectors)");
>  
> +static unsigned int g_bounce_pfn;
> +module_param_named(bounce_pfn, g_bounce_pfn, int, 0444);
> +MODULE_PARM_DESC(bounce_pfn, "Queue Bounce limit (default: 0)");
> +
>  static unsigned int nr_devices = 1;
>  module_param(nr_devices, uint, 0444);
>  MODULE_PARM_DESC(nr_devices, "Number of devices to register");
> @@ -354,6 +358,7 @@ NULLB_DEVICE_ATTR(submit_queues, uint, nullb_apply_submit_queues);
>  NULLB_DEVICE_ATTR(home_node, uint, NULL);
>  NULLB_DEVICE_ATTR(queue_mode, uint, NULL);
>  NULLB_DEVICE_ATTR(blocksize, uint, NULL);
> +NULLB_DEVICE_ATTR(bounce_pfn, uint, NULL);
>  NULLB_DEVICE_ATTR(max_sectors, uint, NULL);
>  NULLB_DEVICE_ATTR(irqmode, uint, NULL);
>  NULLB_DEVICE_ATTR(hw_queue_depth, uint, NULL);
> @@ -472,6 +477,7 @@ static struct configfs_attribute *nullb_device_attrs[] = {
>  	&nullb_device_attr_home_node,
>  	&nullb_device_attr_queue_mode,
>  	&nullb_device_attr_blocksize,
> +	&nullb_device_attr_bounce_pfn,
>  	&nullb_device_attr_max_sectors,
>  	&nullb_device_attr_irqmode,
>  	&nullb_device_attr_hw_queue_depth,
> @@ -543,7 +549,7 @@ nullb_group_drop_item(struct config_group *group, struct config_item *item)
>  static ssize_t memb_group_features_show(struct config_item *item, char *page)
>  {
>  	return snprintf(page, PAGE_SIZE,
> -			"memory_backed,discard,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv,zone_max_open,zone_max_active,blocksize,max_sectors\n");
> +			"memory_backed,discard,bounce_pfn,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv\n");
>  }
>  
>  CONFIGFS_ATTR_RO(memb_group_, features);
> @@ -1610,6 +1616,17 @@ static void null_config_discard(struct nullb *nullb)
>  	blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q);
>  }
>  
> +static void null_config_bounce_pfn(struct nullb *nullb)
> +{
> +	if (nullb->dev->memory_backed && nullb->dev->bounce_pfn == false)

nullb->dev->bounce_pfn is not a bool... So maybe !nullb->dev->bounce_pfn ?

> +		return;
> +
> +	if (!nullb->dev->memory_backed && !g_bounce_pfn)

Why ?

> +		return;
> +
> +	blk_queue_bounce_limit(nullb->q, nullb->dev->bounce_pfn);

Shouldn't this function simply be:

static void null_config_bounce_pfn(struct nullb *nullb)
{
	if (nullb->dev->memory_backed && nullb->dev->bounce_pfn)
		blk_queue_bounce_limit(nullb->q, nullb->dev->bounce_pfn);
}

?

> +}
> +
>  static const struct block_device_operations null_bio_ops = {
>  	.owner		= THIS_MODULE,
>  	.submit_bio	= null_submit_bio,
> @@ -1882,6 +1899,7 @@ static int null_add_dev(struct nullb_device *dev)
>  	blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
>  
>  	null_config_discard(nullb);
> +	null_config_bounce_pfn(nullb);

Where do you assign bounce_pfn to nullb->dev->bounce_pfn ? Something is missing
here...

>  
>  	sprintf(nullb->disk_name, "nullb%d", nullb->index);
>  
> diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h
> index 83504f3cc9d6..cd55f99118bf 100644
> --- a/drivers/block/null_blk/null_blk.h
> +++ b/drivers/block/null_blk/null_blk.h
> @@ -86,6 +86,7 @@ struct nullb_device {
>  	unsigned int queue_mode; /* block interface */
>  	unsigned int blocksize; /* block size */
>  	unsigned int max_sectors; /* Max sectors per command */
> +	unsigned int bounce_pfn; /* bounce page frame number */
>  	unsigned int irqmode; /* IRQ completion handler */
>  	unsigned int hw_queue_depth; /* queue depth */
>  	unsigned int index; /* index of the disk, only valid with a disk */
> 


-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
@ 2021-02-02  9:34   ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:34 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Please also drop the extern while you're at it.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
@ 2021-02-02  9:34   ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:34 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 3/7] blktrace: fix blk_rq_issue documentation
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
@ 2021-02-02  9:34   ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:34 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

On Mon, Feb 01, 2021 at 09:25:40PM -0800, Chaitanya Kulkarni wrote:
> The commit 881245dcff29 ("Add DocBook documentation for the block tracepoints.")
> added the comment for blk_rq_issue() tracepoint. Remove the duplicate
> word from the tracepoint documentation.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 4/7] blktrace: fix blk_rq_merge documentation
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
@ 2021-02-02  9:34   ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:34 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

On Mon, Feb 01, 2021 at 09:25:41PM -0800, Chaitanya Kulkarni wrote:
> The commit f3bdc62fd82e ("blktrace: Provide event for request merging")
> added the comment for blk_rq_merge() tracepoint. Remove the duplicate
> word from the tracepoint documentation.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 5/7] block: get rid of the trace rq insert wrapper
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
@ 2021-02-02  9:36   ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:36 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

On Mon, Feb 01, 2021 at 09:25:42PM -0800, Chaitanya Kulkarni wrote:
> Get rid of the wrapper for trace_block_rq_insert() and call the function
> directly.

The placement of the EXPORT_TRACEPOINT_SYMBOL_GPL looks very strange,
I'd keep it with the other EXPORT_TRACEPOINT_SYMBOL_GPL instances in
blk-core.c.

Otherwise this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 6/7] null_blk: allow disacrd on non-membacked mode
  2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
@ 2021-02-02  9:36   ` Christoph Hellwig
  2021-02-02 20:15     ` Chaitanya Kulkarni
  0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2021-02-02  9:36 UTC (permalink / raw)
  To: Chaitanya Kulkarni
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	johannes.thumshirn, damien.lemoal, bvanassche, dongli.zhang,
	akpm, aravind.ramesh, joshi.k, niklas.cassel, hare, colyli, tj,
	rdunlap, jack, hch

What does this have to do with blktrace?

Also discard is misspelled in the subject.

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

* Re: [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment
  2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
  2021-02-02  9:03   ` Damien Le Moal
@ 2021-02-02  9:55   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Johannes Thumshirn @ 2021-02-02  9:55 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Damien Le Moal, bvanassche,
	dongli.zhang, akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare,
	colyli, tj, rdunlap, jack, hch

On 02/02/2021 06:26, Chaitanya Kulkarni wrote:
> blk_fill_rwbs() is an expoted function, add kernel style documentation               exported ~^

Otherwise,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs()
  2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
  2021-02-02  9:02   ` Damien Le Moal
  2021-02-02  9:04   ` Damien Le Moal
@ 2021-02-02  9:55   ` Johannes Thumshirn
  2 siblings, 0 replies; 37+ messages in thread
From: Johannes Thumshirn @ 2021-02-02  9:55 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Damien Le Moal, bvanassche,
	dongli.zhang, akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare,
	colyli, tj, rdunlap, jack, hch

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 3/7] blktrace: fix blk_rq_issue documentation
  2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
  2021-02-02  9:04   ` Damien Le Moal
@ 2021-02-02  9:56   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Johannes Thumshirn @ 2021-02-02  9:56 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Damien Le Moal, bvanassche,
	dongli.zhang, akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare,
	colyli, tj, rdunlap, jack, hch

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com?

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

* Re: [PATCH 4/7] blktrace: fix blk_rq_merge documentation
  2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
  2021-02-02  9:05   ` Damien Le Moal
@ 2021-02-02  9:57   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Johannes Thumshirn @ 2021-02-02  9:57 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Damien Le Moal, bvanassche,
	dongli.zhang, akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare,
	colyli, tj, rdunlap, jack, hch

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 5/7] block: get rid of the trace rq insert wrapper
  2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
  2021-02-02  9:05   ` Damien Le Moal
@ 2021-02-02  9:58   ` Johannes Thumshirn
  1 sibling, 0 replies; 37+ messages in thread
From: Johannes Thumshirn @ 2021-02-02  9:58 UTC (permalink / raw)
  To: Chaitanya Kulkarni, linux-block
  Cc: paolo.valente, axboe, rostedt, mingo, Damien Le Moal, bvanassche,
	dongli.zhang, akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare,
	colyli, tj, rdunlap, jack, hch

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 6/7] null_blk: allow disacrd on non-membacked mode
  2021-02-02  9:36   ` Christoph Hellwig
@ 2021-02-02 20:15     ` Chaitanya Kulkarni
  0 siblings, 0 replies; 37+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-02 20:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-block, paolo.valente, axboe, rostedt, mingo,
	Johannes Thumshirn, Damien Le Moal, bvanassche, dongli.zhang,
	akpm, Aravind Ramesh, joshi.k, Niklas Cassel, hare, colyli, tj,
	rdunlap, jack

On 2/2/21 01:36, Christoph Hellwig wrote:
> What does this have to do with blktrace?
>
> Also discard is misspelled in the subject.
>

I used these two patches for testing as discard is non conventional
request which I think needs testing to make sure all types of requests
are passing these changes.

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

end of thread, other threads:[~2021-02-02 20:18 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02  5:25 [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
2021-02-02  9:02   ` Damien Le Moal
2021-02-02  9:04   ` Damien Le Moal
2021-02-02  9:55   ` Johannes Thumshirn
2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
2021-02-02  9:03   ` Damien Le Moal
2021-02-02  9:55   ` Johannes Thumshirn
2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
2021-02-02  9:04   ` Damien Le Moal
2021-02-02  9:56   ` Johannes Thumshirn
2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
2021-02-02  9:05   ` Damien Le Moal
2021-02-02  9:57   ` Johannes Thumshirn
2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
2021-02-02  9:05   ` Damien Le Moal
2021-02-02  9:58   ` Johannes Thumshirn
2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
2021-02-02  9:08   ` Damien Le Moal
2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
2021-02-02  9:18   ` Damien Le Moal
2021-02-02  5:25 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni
2021-02-02  5:25 ` [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Chaitanya Kulkarni
2021-02-02  9:34   ` Christoph Hellwig
2021-02-02  5:25 ` [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Chaitanya Kulkarni
2021-02-02  9:34   ` Christoph Hellwig
2021-02-02  5:25 ` [PATCH 3/7] blktrace: fix blk_rq_issue documentation Chaitanya Kulkarni
2021-02-02  9:34   ` Christoph Hellwig
2021-02-02  5:25 ` [PATCH 4/7] blktrace: fix blk_rq_merge documentation Chaitanya Kulkarni
2021-02-02  9:34   ` Christoph Hellwig
2021-02-02  5:25 ` [PATCH 5/7] block: get rid of the trace rq insert wrapper Chaitanya Kulkarni
2021-02-02  9:36   ` Christoph Hellwig
2021-02-02  5:25 ` [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Chaitanya Kulkarni
2021-02-02  9:36   ` Christoph Hellwig
2021-02-02 20:15     ` Chaitanya Kulkarni
2021-02-02  5:25 ` [PATCH 7/7] null_blk: add module param queue bounce limit Chaitanya Kulkarni
2021-02-02  5:29 ` [PATCH 0/7] blktrace: few clenaup Chaitanya Kulkarni

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.