On 11/5/18 2:23 AM, Johannes Thumshirn wrote:
@@ -169,7 +169,7 @@ static inline bool biovec_phys_mergeable(struct request_queue *q, static inline bool __bvec_gap_to_prev(struct request_queue *q, struct bio_vec *bprv, unsigned int offset) { - return offset || + return (offset & queue_virt_boundary(q)) || ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); }
How about changing that expression into the following to make it easier for the compiler to optimize this code?
(offset | (bprv->bv_offset + bprv->bv_len)) & queue_virt_boundary(q) Thanks, Bart.