Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-19 Thread Changheun Lee
> On 4/18/21 10:49 PM, Changheun Lee wrote: > >>> @@ -167,6 +168,7 @@ void blk_queue_max_hw_sectors(struct request_queue > >>> *q, unsigned int max_hw_secto > >>> max_sectors = round_down(max_sectors, > >>>limits->logical_block_size >> SECTOR_SHIFT); > >>> limits->m

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-19 Thread Bart Van Assche
On 4/18/21 10:49 PM, Changheun Lee wrote: >>> @@ -167,6 +168,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, >>> unsigned int max_hw_secto >>> max_sectors = round_down(max_sectors, >>> limits->logical_block_size >> SECTOR_SHIFT); >>> limits->max_sec

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-18 Thread Changheun Lee
> > @@ -167,6 +168,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, > > unsigned int max_hw_secto > > max_sectors = round_down(max_sectors, > > limits->logical_block_size >> SECTOR_SHIFT); > > limits->max_sectors = max_sectors; > > + limits->bio_ma

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-16 Thread Bart Van Assche
On 4/15/21 10:50 PM, Changheun Lee wrote: >> On 4/15/21 3:38 AM, Changheun Lee wrote: >>> @@ -538,6 +540,8 @@ int blk_stack_limits(struct queue_limits *t, struct >>> queue_limits *b, >>> { >>> unsigned int top, bottom, alignment, ret = 0; >>> >>> + t->bio_max_bytes = min_not_zero(t->bio_m

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-15 Thread Changheun Lee
> On 4/15/21 3:38 AM, Changheun Lee wrote: > > @@ -167,6 +168,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, > > unsigned int max_hw_secto > > max_sectors = round_down(max_sectors, > > limits->logical_block_size >> SECTOR_SHIFT); > > limits->max_se

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-15 Thread Bart Van Assche
On 4/15/21 3:38 AM, Changheun Lee wrote: > @@ -167,6 +168,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, > unsigned int max_hw_secto > max_sectors = round_down(max_sectors, >limits->logical_block_size >> SECTOR_SHIFT); > limits->max_sectors

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-15 Thread Changheun Lee
> 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)) > > + <

Re: [PATCH v7 1/3] bio: limit bio max size

2021-04-13 Thread Bart Van Assche
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

[PATCH v7 1/3] bio: limit bio max size

2021-04-12 Thread Changheun Lee
bio size can grow up to 4GB when muli-page bvec is enabled. but sometimes it would lead to inefficient behaviors. in case of large chunk direct I/O, - 32MB chunk read in user space - all pages for 32MB would be merged to a bio structure if the pages physical addresses are contiguous. it makes some