Messages in this thread | | | Subject | Re: [PATCH v7 1/3] bio: limit bio max size | From | Bart Van Assche <> | Date | Tue, 13 Apr 2021 09:18:00 -0700 |
| |
On 4/12/21 7:55 PM, Changheun Lee wrote: > +unsigned int bio_max_size(struct bio *bio) > +{ > + struct request_queue *q = bio->bi_bdev->bd_disk->queue; > + > + if (blk_queue_limit_bio_size(q)) > + return blk_queue_get_max_sectors(q, bio_op(bio)) > + << SECTOR_SHIFT; > + > + return UINT_MAX; > +}
This patch adds an if-statement to the hot path and that may have a slight negative performance impact. I recommend to follow the approach of max_hw_sectors. That means removing QUEUE_FLAG_LIMIT_BIO_SIZE and to initialize the maximum bio size to UINT_MAX in blk_set_default_limits().
Thanks,
Bart.
| |