* [RFC PATCH] blk-mq: change bio_set_ioprio to inline
@ 2022-08-30 9:45 Liu Song
2022-08-30 12:48 ` Chaitanya Kulkarni
2022-08-30 13:59 ` Jens Axboe
0 siblings, 2 replies; 7+ messages in thread
From: Liu Song @ 2022-08-30 9:45 UTC (permalink / raw)
To: axboe; +Cc: linux-block, linux-kernel
From: Liu Song <liusong@linux.alibaba.com>
Change "bio_set_ioprio" to inline to avoid calling overhead.
Signed-off-by: Liu Song <liusong@linux.alibaba.com>
---
block/blk-mq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index c96c8c4..a17bc83 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-30 9:45 [RFC PATCH] blk-mq: change bio_set_ioprio to inline Liu Song
@ 2022-08-30 12:48 ` Chaitanya Kulkarni
2022-08-31 0:48 ` Liu Song
2022-08-30 13:59 ` Jens Axboe
1 sibling, 1 reply; 7+ messages in thread
From: Chaitanya Kulkarni @ 2022-08-30 12:48 UTC (permalink / raw)
To: Liu Song; +Cc: linux-block, axboe, linux-kernel
On 8/30/22 02:45, Liu Song wrote:
> From: Liu Song <liusong@linux.alibaba.com>
>
> Change "bio_set_ioprio" to inline to avoid calling overhead.
>
> Signed-off-by: Liu Song <liusong@linux.alibaba.com>
for performance overhead please provide quantitative data
-ck
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-30 9:45 [RFC PATCH] blk-mq: change bio_set_ioprio to inline Liu Song
2022-08-30 12:48 ` Chaitanya Kulkarni
@ 2022-08-30 13:59 ` Jens Axboe
2022-08-31 0:42 ` Liu Song
1 sibling, 1 reply; 7+ messages in thread
From: Jens Axboe @ 2022-08-30 13:59 UTC (permalink / raw)
To: Liu Song; +Cc: linux-block, linux-kernel
On 8/30/22 3:45 AM, Liu Song wrote:
> From: Liu Song <liusong@linux.alibaba.com>
>
> 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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-30 13:59 ` Jens Axboe
@ 2022-08-31 0:42 ` Liu Song
2022-08-31 0:59 ` Jens Axboe
0 siblings, 1 reply; 7+ messages in thread
From: Liu Song @ 2022-08-31 0:42 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, linux-kernel
On 2022/8/30 21:59, Jens Axboe wrote:
> On 8/30/22 3:45 AM, Liu Song wrote:
>> From: Liu Song <liusong@linux.alibaba.com>
>>
>> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-30 12:48 ` Chaitanya Kulkarni
@ 2022-08-31 0:48 ` Liu Song
0 siblings, 0 replies; 7+ messages in thread
From: Liu Song @ 2022-08-31 0:48 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: linux-block, axboe, linux-kernel
On 2022/8/30 20:48, Chaitanya Kulkarni wrote:
> On 8/30/22 02:45, Liu Song wrote:
>> From: Liu Song <liusong@linux.alibaba.com>
>>
>> Change "bio_set_ioprio" to inline to avoid calling overhead.
>>
>> Signed-off-by: Liu Song <liusong@linux.alibaba.com>
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-31 0:42 ` Liu Song
@ 2022-08-31 0:59 ` Jens Axboe
2022-08-31 1:22 ` Liu Song
0 siblings, 1 reply; 7+ messages in thread
From: Jens Axboe @ 2022-08-31 0:59 UTC (permalink / raw)
To: Liu Song; +Cc: linux-block, linux-kernel
On 8/30/22 6:42 PM, Liu Song wrote:
>
> On 2022/8/30 21:59, Jens Axboe wrote:
>> On 8/30/22 3:45 AM, Liu Song wrote:
>>> From: Liu Song <liusong@linux.alibaba.com>
>>>
>>> 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.
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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH] blk-mq: change bio_set_ioprio to inline
2022-08-31 0:59 ` Jens Axboe
@ 2022-08-31 1:22 ` Liu Song
0 siblings, 0 replies; 7+ messages in thread
From: Liu Song @ 2022-08-31 1:22 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, linux-kernel
On 2022/8/31 08:59, Jens Axboe wrote:
> On 8/30/22 6:42 PM, Liu Song wrote:
>> On 2022/8/30 21:59, Jens Axboe wrote:
>>> On 8/30/22 3:45 AM, Liu Song wrote:
>>>> From: Liu Song <liusong@linux.alibaba.com>
>>>>
>>>> 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.
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-08-31 1:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 9:45 [RFC PATCH] blk-mq: change bio_set_ioprio to inline Liu Song
2022-08-30 12:48 ` Chaitanya Kulkarni
2022-08-31 0:48 ` Liu Song
2022-08-30 13:59 ` Jens Axboe
2022-08-31 0:42 ` Liu Song
2022-08-31 0:59 ` Jens Axboe
2022-08-31 1:22 ` Liu Song
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.