From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838AbdIRPuh (ORCPT ); Mon, 18 Sep 2017 11:50:37 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:35673 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbdIRPuf (ORCPT ); Mon, 18 Sep 2017 11:50:35 -0400 Date: Mon, 18 Sep 2017 08:50:29 -0700 From: Christoph Hellwig To: =?utf-8?B?6ZmI5Y2O5omN?= Cc: Christoph Hellwig , "James E . J . Bottomley" , "Martin K . Petersen" , Andrew Morton , Fuxin Zhang , linux-scsi , linux-kernel , stable Subject: Re: [PATCH V5 3/3] scsi: Align queue to ARCH_DMA_MINALIGN innon-coherent DMA mode Message-ID: <20170918155029.GB16672@infradead.org> References: <1505708574-5281-1-git-send-email-chenhc@lemote.com> <20170918052051.GA29118@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) 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 Mon, Sep 18, 2017 at 03:03:30PM +0800, 陈华才 wrote: > I don't think dma_get_cache_alignment is the "absolute minimum alignment" in all cases. At least on MIPS/Loongson, if we use I/O coherent mode (Cached DMA mode), align block queue to 4Bytes is enough. If we align block queue to dma_get_cache_alignment in I/O coherent mode, there are peformance lost because we cannot use zero-copy in most cases (user buffers are usually not aligned). If you systems is I/O coherent it should report 1 ARCH_DMA_MINALIGN / dma_get_cache_alignment(). Note that many drivers only support 512 byte aligned mappings for block I/O and they've done pretty fine so far.