From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f170.google.com ([209.85.215.170]:40300 "EHLO mail-pg1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388855AbeKGASx (ORCPT ); Tue, 6 Nov 2018 19:18:53 -0500 Subject: Re: [PATCH] block: respect virtual boundary mask in bvecs To: Johannes Thumshirn , Jens Axboe Cc: Linux Block Layer Mailinglist , Hannes Reinecke , Linux Kernel Mailinglist , Jan Kara , Sagi Grimberg References: <20181105102301.9752-1-jthumshirn@suse.de> From: Bart Van Assche Message-ID: Date: Tue, 6 Nov 2018 06:53:16 -0800 MIME-Version: 1.0 In-Reply-To: <20181105102301.9752-1-jthumshirn@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-block-owner@vger.kernel.org List-Id: linux-block@vger.kernel.org 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.