From: Liu Song <[email protected]>
Change "bio_set_ioprio" to inline to avoid calling overhead.
Signed-off-by: Liu Song <[email protected]>
---
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
On 8/30/22 02:45, Liu Song wrote:
> 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
On 8/30/22 3:45 AM, Liu Song wrote:
> 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.
--
Jens Axboe
On 2022/8/30 20:48, Chaitanya Kulkarni wrote:
> On 8/30/22 02:45, Liu Song wrote:
>> 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
>
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 <[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.
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
On 2022/8/30 21:59, Jens Axboe wrote:
> On 8/30/22 3:45 AM, Liu Song wrote:
>> 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
>
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 <[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.
> 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