Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1374007pxb; Mon, 11 Oct 2021 04:47:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpLr3CDSE3KGDc7Ej0CwW0MmU8RC+1qXsMSK9pz+Qvh/MpHe9FgWdPozl+3mRI/pjh/m3Y X-Received: by 2002:a62:7904:0:b0:44c:ca08:1956 with SMTP id u4-20020a627904000000b0044cca081956mr22878548pfc.47.1633952827672; Mon, 11 Oct 2021 04:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633952827; cv=none; d=google.com; s=arc-20160816; b=prAhGCO/guWngJQdfzjifyR55wvjWbiAjOPvmfsz6tOrqRuDDdI/n0MGL9t+0x9kVh JMHPdpbvJCGKHLA3MIpAccvORh02nNzaAPjxJc40N2J8gnx+HB6r2ke+oHQX41rNTNv6 v24YGBgQmB6yxxvp+zE50PSo1D0c51CoBRI3IU3xrif/4zSU+0Sn73HH0+JmHCiCQSk8 OB9InJke6hzL+28yukHJYzM9dktp2YyIqBO4uRx5qTVwZd60HGoQHBE8RQ6uGtWlbung HU7nT31+BkzBZUKqbKeTUElFEJsAzX07u+ETQitIzLQaF7wNzqfQwASTMKax+t/Kz6KK sqEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cvYAB16Yo+aifR4lRnW54tAFDJGeCwZKTi5SgawIbpY=; b=S2+rYZkWy1wt7C7BD/cZJz/igGNifo1xf8/OkcwSAIHQqfy2mAmznoB+eSvvWeDQtz dva195rMQhi5Udkf/aE29Q5v8fr0rNhjkoafBI4HpJnMLOnJ6kR/RX166UwCQffk4NrN 0i/dvMfgm2/0TG4RZ6cjUH8aWfYWdR+0lkqntl1AHo7ddHcJmBMA9qa8iSCgR7Odzl+V Mlfoq5mKFlg0tTnkl8x/uu+dC53Nd5Ep4O8nMCmymrPW0SFm25Kek1hONhMKLUZuUXgy mMBo7ldydYldQ/fOa6Nj0k3v7BX1BCup2jMFKY4kQSmXekm0WRXNqRlR6eazSai9VKRe slOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si9744729pjv.89.2021.10.11.04.46.55; Mon, 11 Oct 2021 04:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234642AbhJKHG1 (ORCPT + 99 others); Mon, 11 Oct 2021 03:06:27 -0400 Received: from mx24.baidu.com ([111.206.215.185]:36484 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234736AbhJKHGI (ORCPT ); Mon, 11 Oct 2021 03:06:08 -0400 Received: from BJHW-Mail-Ex10.internal.baidu.com (unknown [10.127.64.33]) by Forcepoint Email with ESMTPS id 8B1C7A047B63647B8EA3; Mon, 11 Oct 2021 15:04:06 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex10.internal.baidu.com (10.127.64.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 11 Oct 2021 15:04:06 +0800 Received: from localhost (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 11 Oct 2021 15:04:06 +0800 Date: Mon, 11 Oct 2021 15:04:05 +0800 From: Cai Huoqing To: Christoph Hellwig CC: Michael Cyr , "James E.J. Bottomley" , "Martin K. Petersen" , , , Subject: Re: [PATCH] scsi: ibmvscsi_tgt: Use dma_alloc_coherent() instead of get_zeroed_page/dma_map_single() Message-ID: <20211011070405.GA173@LAPTOP-UKSR4ENP.internal.baidu.com> References: <20211010160055.488-1-caihuoqing@baidu.com> 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.9.4 (2018-02-28) X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex17.internal.baidu.com (172.31.51.11) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex10_2021-10-11 15:04:06:519 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11 10月 21 07:42:28, Christoph Hellwig wrote: > On Mon, Oct 11, 2021 at 12:00:53AM +0800, Cai Huoqing wrote: > > Replacing get_zeroed_page/free_page/dma_map_single/dma_unmap_single() > > with dma_alloc_coherent/dma_free_coherent() helps to reduce > > code size, and simplify the code, and coherent DMA will not > > clear the cache every time. > > This explanation does not make any sense whatsoever. Please explain > why it would an show numbers. Hi Christoph, thanks for your feedback. In this case, just simplify the code. 10 insertions(+), 31 deletions(-) dma_sync_ API is not called, I think the hardware may keep cache coherent directly or is a no cache system. No need to make perfermance compare. thanks Cai