All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
@ 2021-10-05 15:32 Jens Axboe
  2021-10-05 17:04 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2021-10-05 15:32 UTC (permalink / raw)
  To: linux-block

Unnecessary function call, if we don't have that specific configuration
option enabled.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/block/blk-core.c b/block/blk-core.c
index 5454db2fa263..a267f11f55cb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio)
 
 static noinline int should_fail_bio(struct bio *bio)
 {
+#ifdef CONFIG_FAIL_MAKE_REQUEST
 	if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size))
 		return -EIO;
+#endif
 	return 0;
 }
 ALLOW_ERROR_INJECTION(should_fail_bio, ERRNO);

-- 
Jens Axboe


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

* Re: [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
  2021-10-05 15:32 [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST Jens Axboe
@ 2021-10-05 17:04 ` Bart Van Assche
  2021-10-05 17:10   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2021-10-05 17:04 UTC (permalink / raw)
  To: Jens Axboe, linux-block

On 10/5/21 8:32 AM, Jens Axboe wrote:
> Unnecessary function call, if we don't have that specific configuration
> option enabled.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> ---
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 5454db2fa263..a267f11f55cb 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio)
>   
>   static noinline int should_fail_bio(struct bio *bio)
>   {
> +#ifdef CONFIG_FAIL_MAKE_REQUEST
>   	if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size))
>   		return -EIO;
> +#endif
>   	return 0;
>   }
>   ALLOW_ERROR_INJECTION(should_fail_bio, ERRNO);

Has the performance impact of this patch been measured? I'm asking because I
found the following in blk-core.c:

#ifdef CONFIG_FAIL_MAKE_REQUEST
[ ... ]
#else /* CONFIG_FAIL_MAKE_REQUEST */
static inline bool should_fail_request(struct block_device *part,
					unsigned int bytes)
{
	return false;
}
#endif /* CONFIG_FAIL_MAKE_REQUEST */

Thanks,

Bart.

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

* Re: [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
  2021-10-05 17:04 ` Bart Van Assche
@ 2021-10-05 17:10   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-10-05 17:10 UTC (permalink / raw)
  To: Bart Van Assche, linux-block

On 10/5/21 11:04 AM, Bart Van Assche wrote:
> On 10/5/21 8:32 AM, Jens Axboe wrote:
>> Unnecessary function call, if we don't have that specific configuration
>> option enabled.
>>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>>
>> ---
>>
>> diff --git a/block/blk-core.c b/block/blk-core.c
>> index 5454db2fa263..a267f11f55cb 100644
>> --- a/block/blk-core.c
>> +++ b/block/blk-core.c
>> @@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio)
>>   
>>   static noinline int should_fail_bio(struct bio *bio)
>>   {
>> +#ifdef CONFIG_FAIL_MAKE_REQUEST
>>   	if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size))
>>   		return -EIO;
>> +#endif
>>   	return 0;
>>   }
>>   ALLOW_ERROR_INJECTION(should_fail_bio, ERRNO);
> 
> Has the performance impact of this patch been measured? I'm asking because I
> found the following in blk-core.c:
> 
> #ifdef CONFIG_FAIL_MAKE_REQUEST
> [ ... ]
> #else /* CONFIG_FAIL_MAKE_REQUEST */
> static inline bool should_fail_request(struct block_device *part,
> 					unsigned int bytes)
> {
> 	return false;
> }
> #endif /* CONFIG_FAIL_MAKE_REQUEST */

True, might be a leftover from some other experimentation. Looks like we
can just ignore that patch.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-10-05 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 15:32 [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST Jens Axboe
2021-10-05 17:04 ` Bart Van Assche
2021-10-05 17:10   ` Jens Axboe

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.