Linux block layer
 help / color / mirror / Atom feed
* [PATCH 0/2] block: remove unnecessary helpers
@ 2023-03-27  7:34 Chaitanya Kulkarni
  2023-03-27  7:34 ` [PATCH 1/2] block: open code __blk_account_io_start() Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2023-03-27  7:34 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, Chaitanya Kulkarni

Hi,

There is only one caller for __blk_account_io_start() and
__blk_account_io_done(), both function are small enough to fit in their
respective callers blk_account_io_start() and blk_account_io_done().

Remove both the functions and opencode in the their respective callers
blk_account_io_start() and blk_account_io_done().

Below is a testlog with simple dd write command on null_blk

-ck

Chaitanya Kulkarni (2):
  block: open code __blk_account_io_start()
  block: open code __blk_account_io_done()

 block/blk-mq.c | 56 ++++++++++++++++++++++----------------------------
 1 file changed, 24 insertions(+), 32 deletions(-)

Debug diff :-

linux-block (for-next) # git diff 
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 1b304f66f4e8..c04fbe7cebc1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -960,6 +960,7 @@ static inline void blk_account_io_done(struct request *req, u64 now)
         * normal IO on queueing nor completion.  Accounting the
         * containing request is enough.
         */
+       printk(KERN_INFO" <<<<< -%s %d\n", __func__, __LINE__);
        if (blk_do_io_stat(req) && req->part &&
            !(req->rq_flags & RQF_FLUSH_SEQ)) {
                const int sgrp = op_stat_group(req_op(req));
@@ -969,11 +970,13 @@ static inline void blk_account_io_done(struct request *req, u64 now)
                part_stat_inc(req->part, ios[sgrp]);
                part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns);
                part_stat_unlock();
+               printk(KERN_INFO" <<<<< -%s %d\n", __func__, __LINE__);
        }
 }
 
 static inline void blk_account_io_start(struct request *req)
 {
+       printk(KERN_INFO" <>>>>>> -%s %d\n", __func__, __LINE__);
        if (blk_do_io_stat(req)) {
                /*
                 * All non-passthrough requests are created from a bio with one
@@ -989,6 +992,7 @@ static inline void blk_account_io_start(struct request *req)
                part_stat_lock();
                update_io_ticks(req->part, jiffies, false);
                part_stat_unlock();
+               printk(KERN_INFO" <>>>>>> -%s %d\n", __func__, __LINE__);
        }
 }

[   79.477154]  <<<<< -blk_account_io_done 963
[   79.477155]  <<<<< -blk_account_io_done 973
[   79.477157]  <>>>>>> -blk_account_io_start 979
[   79.477158]  <>>>>>> -blk_account_io_start 995
[   79.477343]  <<<<< -blk_account_io_done 963
[   79.477347]  <<<<< -blk_account_io_done 973
[   79.477354]  <>>>>>> -blk_account_io_start 979
[   79.477355]  <>>>>>> -blk_account_io_start 995
[   79.477538]  <<<<< -blk_account_io_done 963
[   79.477540]  <<<<< -blk_account_io_done 973
[   79.477542]  <>>>>>> -blk_account_io_start 979
[   79.477543]  <>>>>>> -blk_account_io_start 995
[   79.477721]  <<<<< -blk_account_io_done 963
[   79.477722]  <<<<< -blk_account_io_done 973
[   79.477724]  <>>>>>> -blk_account_io_start 979
[   79.477725]  <>>>>>> -blk_account_io_start 995
[   79.477752]  <>>>>>> -blk_account_io_start 979
[   79.477755]  <>>>>>> -blk_account_io_start 995
[   79.477910]  <<<<< -blk_account_io_done 963
[   79.477912]  <<<<< -blk_account_io_done 973
[   79.478005]  <>>>>>> -blk_account_io_start 979
[   79.478006]  <>>>>>> -blk_account_io_start 995
[   79.478091]  <<<<< -blk_account_io_done 963
[   79.478093]  <<<<< -blk_account_io_done 973
[   79.478348]  <<<<< -blk_account_io_done 963
[   79.478353]  <<<<< -blk_account_io_done 973
[   79.478360]  <>>>>>> -blk_account_io_start 979
[   79.478361]  <>>>>>> -blk_account_io_start 995
[   79.478551]  <<<<< -blk_account_io_done 963
[   79.478553]  <<<<< -blk_account_io_done 973
[   79.478556]  <>>>>>> -blk_account_io_start 979
[   79.478557]  <>>>>>> -blk_account_io_start 995
[   79.478731]  <<<<< -blk_account_io_done 963
[   79.478733]  <<<<< -blk_account_io_done 973
[   79.478735]  <>>>>>> -blk_account_io_start 979
[   79.478736]  <>>>>>> -blk_account_io_start 995
[   79.478906]  <<<<< -blk_account_io_done 963
[   79.478907]  <<<<< -blk_account_io_done 973
[   79.478909]  <>>>>>> -blk_account_io_start 979
[   79.478910]  <>>>>>> -blk_account_io_start 995
[   79.479086]  <<<<< -blk_account_io_done 963
[   79.479087]  <<<<< -blk_account_io_done 973
[   79.479089]  <>>>>>> -blk_account_io_start 979
[   79.479090]  <>>>>>> -blk_account_io_start 995
[   79.479262]  <<<<< -blk_account_io_done 963
[   79.479266]  <<<<< -blk_account_io_done 973
[   79.479273]  <>>>>>> -blk_account_io_start 979
[   79.479274]  <>>>>>> -blk_account_io_start 995
[   79.479448]  <<<<< -blk_account_io_done 963
[   79.479449]  <<<<< -blk_account_io_done 973
[   79.479451]  <>>>>>> -blk_account_io_start 979
[   79.479452]  <>>>>>> -blk_account_io_start 995
[   79.479631]  <<<<< -blk_account_io_done 963
[   79.479633]  <<<<< -blk_account_io_done 973
[   79.479635]  <>>>>>> -blk_account_io_start 979
[   79.479636]  <>>>>>> -blk_account_io_start 995
[   79.479797]  <<<<< -blk_account_io_done 963
[   79.479798]  <<<<< -blk_account_io_done 973

-- 
2.29.0


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

end of thread, other threads:[~2023-03-27 22:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27  7:34 [PATCH 0/2] block: remove unnecessary helpers Chaitanya Kulkarni
2023-03-27  7:34 ` [PATCH 1/2] block: open code __blk_account_io_start() Chaitanya Kulkarni
2023-03-27 22:12   ` Christoph Hellwig
2023-03-27 22:23     ` Chaitanya Kulkarni
2023-03-27 22:43     ` Jens Axboe
2023-03-27  7:34 ` [PATCH 2/2] block: open code __blk_account_io_done() Chaitanya Kulkarni
2023-03-27 19:23 ` [PATCH 0/2] block: remove unnecessary helpers Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox