From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A584BC433DF for ; Fri, 21 Aug 2020 09:02:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 665C520578 for ; Fri, 21 Aug 2020 09:02:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gW2OLpcY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="f798jvHp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 665C520578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LBinxHnKOGY2WtI3K5i2AbacutTfIZl9DPyu7EwL4N4=; b=gW2OLpcYAz/kb1TTwsUJqsh57 He6rNKCD9cxA9/Hglj2z/4FDaF11yEa3Yw7SIuCIcEjRDxZX9w1vYqb58rvjXJs9Lp3lmbilEUyYk jrcY2NWwy6e3tW1CLK+VciIo62CjbpE0mcViSDROP7NepH8v8vFBPj8Pdk2LefqI9hn3LyqWCpNR1 O6QLH/pwLiqwerpeTRPCj5AtUNupRjrnOzFpODFqT14bDD5g7rmNQxBIlasDk9ls0iRxAJFOsK6ym YzEcIUAwPZQq/qXCXqNTvmxs6fXvf0CJu5NGa6mDfu4mDtrcKs4bATmX1xLsaTMU/Pscx59LXflmt ee6XQ5kYQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k92vN-0001pa-K1; Fri, 21 Aug 2020 09:01:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k92vK-0001oo-Jg for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 09:01:23 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DF6C20578; Fri, 21 Aug 2020 09:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598000481; bh=PGxw16Sb15h4INR8rVD1HKJzCXHduThJtSaBTgYEwQc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f798jvHppuLjWlvS5plc4g84ly/Jkcfa4C7HL9B7ytEenJk95uzyKx44D5wL25KH0 9W9yuKvfjYApvHGKh9Vjwqn+0d/ea93GtAdK8xnzlLdVQdGpI+tNFC4besQOJtfaFE TEYT+mr5RWQw3VXjZXrYoE6sm2dLC+MlCIiPSdxk= Date: Fri, 21 Aug 2020 10:01:16 +0100 From: Will Deacon To: Barry Song Subject: Re: [PATCH v6 2/2] arm64: mm: reserve per-numa CMA to localize coherent dma buffers Message-ID: <20200821090116.GB20255@willie-the-truck> References: <20200821022615.28596-1-song.bao.hua@hisilicon.com> <20200821022615.28596-3-song.bao.hua@hisilicon.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200821022615.28596-3-song.bao.hua@hisilicon.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200821_050122_728038_77542172 X-CRM114-Status: GOOD ( 21.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , Steve Capper , catalin.marinas@arm.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Nicolas Saenz Julienne , ganapatrao.kulkarni@cavium.com, Andrew Morton , huangdaode@huawei.com, robin.murphy@arm.com, hch@lst.de, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 21, 2020 at 02:26:15PM +1200, Barry Song wrote: > Right now, smmu is using dma_alloc_coherent() to get memory to save queues > and tables. Typically, on ARM64 server, there is a default CMA located at > node0, which could be far away from node2, node3 etc. > with this patch, smmu will get memory from local numa node to save command > queues and page tables. that means dma_unmap latency will be shrunk much. > Meanwhile, when iommu.passthrough is on, device drivers which call dma_ > alloc_coherent() will also get local memory and avoid the travel between > numa nodes. > > Cc: Christoph Hellwig > Cc: Marek Szyprowski > Cc: Will Deacon > Cc: Robin Murphy > Cc: Ganapatrao Kulkarni > Cc: Catalin Marinas > Cc: Nicolas Saenz Julienne > Cc: Steve Capper > Cc: Andrew Morton > Cc: Mike Rapoport > Signed-off-by: Barry Song > --- > -v6: rebase on top of 5.9-rc1 > > arch/arm64/mm/init.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 481d22c32a2e..f1c75957ff3c 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -429,6 +429,8 @@ void __init bootmem_init(void) > arm64_hugetlb_cma_reserve(); > #endif > > + dma_pernuma_cma_reserve(); I think will have to do for now, but I still wish that more of this was driven from the core code so that we don't have to worry about initialisation order and whether things are early/late enough on a per-arch basis. Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel