Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Maurizio Lombardi
On Tue, May 27, 2014 at 10:04:58PM +0800, Ming Lei wrote: > > Looks your approach is simpler. > > But looks there is one problem if I understand correctly: > __blk_recalc_rq_segments() may not cover the last vector > because bio->bi_iter.bi_size isn't updated until the end of > __bio_add_page().

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Ming Lei
On Tue, May 27, 2014 at 7:58 PM, Maurizio Lombardi wrote: > On Tue, May 27, 2014 at 06:15:45PM +0800, Ming Lei wrote: >> >> If the page can be merged to last segment, it should have been >> covered by code in branch of 'if (bio->bi_vcnt > 0) ...', shouldn't it? >> >> Or maybe it is better to make

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Maurizio Lombardi
On Tue, May 27, 2014 at 06:15:45PM +0800, Ming Lei wrote: > > If the page can be merged to last segment, it should have been > covered by code in branch of 'if (bio->bi_vcnt > 0) ...', shouldn't it? > > Or maybe it is better to make that code cover your case since > looks your case is similar wit

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Maurizio Lombardi
On Tue, May 27, 2014 at 06:15:45PM +0800, Ming Lei wrote: > > If the page can be merged to last segment, it should have been > covered by code in branch of 'if (bio->bi_vcnt > 0) ...', shouldn't it? > > Or maybe it is better to make that code cover your case since > looks your case is similar wit

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Ming Lei
Hi Maurizio, On Thu, May 1, 2014 at 9:56 PM, Maurizio Lombardi wrote: > The original behaviour is to refuse to add a new page if the maximum number > of segments has been reached, regardless of the fact the page we are > going to add can be merged into the last segment or not. If the page can be

[PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-01 Thread Maurizio Lombardi
The original behaviour is to refuse to add a new page if the maximum number of segments has been reached, regardless of the fact the page we are going to add can be merged into the last segment or not. Unfortunately, when the system runs under heavy memory fragmentation conditions, a driver may tr