blk-mq: change bio_set_ioprio to inline
RFC PATCH 1/1 blk-mq: change bio_set_ioprio to inline
From: Liu Song <[email protected]>
Change "bio_set_ioprio" to inline to avoid calling overhead.
--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +1 -1
@@ -2766,7 +2766,7 @@ static inline struct request *blk_mq_get_cached_request(struct request_queue *q,return rq; } -static void bio_set_ioprio (struct bio *bio) +static inline void bio_set_ioprio (struct bio *bio) {/* Nobody set ioprio so far? Initialize it based on task's nice value */ if (IOPRIO_PRIO_CLASS (bio->bi_ioprio) ==IOPRIO_CLASS_NONE )
Signature · 1 line
1.8.3.1
Quoted 5 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.Signed-off-by Liu Song <[email protected]>
for performance overhead please provide quantitative data
-ck
Quoted 10 lines · Chaitanya Kulkarni
Quoted 5 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.Signed-off-by Liu Song <[email protected]>for performance overhead please provide quantitative data
-ck
This is a small adjustment, and even if performance comparison data is obtained for targeted design use cases, it is not universal. If the inline by the compiler is successful, the number of instructions will be reduced.
Thanks
Quoted 1 line
Jens Axboe
maintainerQuoted 3 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.
Let's not try to 2nd guess the compiler here. Most things that are marked inline should not be.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.Let's not try to 2nd guess the compiler here. Most things that are marked inline should not be.
Agree, I think there is something wrong with the commit log written here, it should be expected to reduce the call overhead, bio_set_ioprio seems to be appropriate to use inline.
Thanks
Quoted 1 line
Jens Axboe
maintainerQuoted 11 lines · Liu Song
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.Let's not try to 2nd guess the compiler here. Most things that are marked inline should not be.
Agree, I think there is something wrong with the commit log written here, it should be expected to reduce the call overhead,
bio_set_ioprioseems to be appropriate to use inline.
I'm sure it's worth inlining, but did you check if it isn't already? If it's small I'd fully expect the compiler to inline it already, without needing to add things to do so.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Liu Song
Quoted 4 lines · Jens Axboe
Quoted 3 lines · Liu Song
From: Liu Song <[email protected]>
Change "
bio_set_ioprio" to inline to avoid calling overhead.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Let's not try to 2nd guess the compiler here. Most things that are marked inline should not be.
Agree, I think there is something wrong with the commit log written here, it should be expected to reduce the call overhead,
bio_set_ioprioseems to be appropriate to use inline.I'm sure it's worth inlining, but did you check if it isn't already? If it's small I'd fully expect the compiler to inline it already, without needing to add things to do so.
It is indeed possible, thanks for your reply.
Thanks