From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932141AbcDGPzh (ORCPT ); Thu, 7 Apr 2016 11:55:37 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:38299 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbcDGPzf (ORCPT ); Thu, 7 Apr 2016 11:55:35 -0400 Date: Thu, 7 Apr 2016 08:55:33 -0700 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [RFC] weird semantics of SG_DXFER_TO_FROM_DEV in BLK_DEV_SKD (drivers/block/skd*) Message-ID: <20160407155533.GB8703@infradead.org> References: <20160404033845.GE17997@ZenIV.linux.org.uk> <20160404065220.GA9447@infradead.org> <20160404171611.GF17997@ZenIV.linux.org.uk> <20160404184736.GG17997@ZenIV.linux.org.uk> <20160404195042.GH17997@ZenIV.linux.org.uk> <20160404234508.GJ17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160404234508.GJ17997@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2016 at 12:45:08AM +0100, Al Viro wrote: > AFAICS, what we need there is simply > nr_pages = iov_iter_npages(iter); > alignment = iov_iter_alignment(iter); > if (alignment & (queue_dma_alignment(q) | q->dma_pad_mask)) > copy = true; > and I really wonder if we care about special-casing the situation when the > ends are not aligned to queue_virt_boundary(q). If we don't, we might as > well add queue_virt_boundary(q) to the mask we are checking. If we do, > it's not hard to add a variant that would calculate both the alignment and > alignment for internal boundaries... I suspect this is the right thing to do. Care to send a patch to Jens?