Thread (17 messages) 17 messages, 4 authors, 2021-05-03

Re: [PATCH v2] block: Improve limiting the bio size

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-04-27 15:00:06

On 4/26/21 9:12 PM, Changheun Lee wrote:
Actually I checked "bio->bi_disk" at first as below. It works well.
Agreed that the bi_disk pointer needs to be checked.
I think "bi_bdev->bd_disk" checking might be needed too.
bio_max_size() occurs in the hot path. Since if-tests have a runtime
cost I'd like to keep the number of if-tests inside bio_max_size() to a
minimum.

I only found one bd_disk assignment in the kernel tree, namely inside
bdev_alloc(). The two bdev_alloc() calls I found inside the kernel tree
pass a valid disk pointer to bdev_alloc(). So I think it is not
necessary to check the disk pointer inside bio_max_size().

Thanks,

Bart.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help