mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
block: only allow contiguous page structs in a bio_vec
We currently have to call nth_page when iterating over pages inside a bio_vec. Jens complained a while ago that this is fairly expensive. To mitigate this we can check that that the actual page structures are contiguous when adding them to the bio, and just do check pointer arithmetics later on. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
7321ecbfc7
commit
52d52d1c98
2 changed files with 11 additions and 11 deletions
|
|
@ -659,8 +659,13 @@ static inline bool page_is_mergeable(const struct bio_vec *bv,
|
|||
return false;
|
||||
if (xen_domain() && !xen_biovec_phys_mergeable(bv, page))
|
||||
return false;
|
||||
if (same_page && (vec_end_addr & PAGE_MASK) != page_addr)
|
||||
return false;
|
||||
|
||||
if ((vec_end_addr & PAGE_MASK) != page_addr) {
|
||||
if (same_page)
|
||||
return false;
|
||||
if (pfn_to_page(PFN_DOWN(vec_end_addr)) + 1 != page)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue