Re: [PATCH] block: respect virtual boundary mask in bvecs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux