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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 6F436C433E0 for ; Thu, 25 Jun 2020 11:18:01 +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 2D73420781 for ; Thu, 25 Jun 2020 11:18:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l6DuMVoc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D73420781 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8WS/r9fvLaXrgiHvq8IfFhd3OfzFdJIrA4UXzQiJ+gw=; b=l6DuMVocbaL6qjeOdAV5rZVep BP8IK37ni+o5RGJ3IQCr9J6HPaVwvsr2nOqSUxS8YLQai1GH5FmaSJiGjv8lN+yw+t+SLPlSagq/o ZLUUw8LZLgWnomJZzRspK6WZvQsxdvV+M3lcQJHwiTljaEW6r02oxCh05kteiCpjZRob3lgTBp68i MahbW+AlhC+t9P92CCRUXktG7uBwEWhJsrOVhxRO8lnnkA+7SQnlk2Pg92bchpKxWvyl0SlsoP+6j m+YHXvJdLD9gqFvpTpi+kXyLV+BDW0eXVOeR1XR60Qe6/oH3ACCnVtA/+hq+5xwgozQVVdIuwl3us hD3WoHqTw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joPrL-0008HO-Mz; Thu, 25 Jun 2020 11:15:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joPrI-0008Gn-Gb for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 11:15:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 680B21FB; Thu, 25 Jun 2020 04:15:55 -0700 (PDT) Received: from [10.57.13.97] (unknown [10.57.13.97]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 571643F73C; Thu, 25 Jun 2020 04:15:53 -0700 (PDT) Subject: Re: [PATCH v2 2/2] arm64: mm: reserve per-numa CMA after numa_init To: Barry Song , hch@lst.de, m.szyprowski@samsung.com, will@kernel.org, ganapatrao.kulkarni@cavium.com, catalin.marinas@arm.com References: <20200625074330.13668-1-song.bao.hua@hisilicon.com> <20200625074330.13668-3-song.bao.hua@hisilicon.com> From: Robin Murphy Message-ID: <53b97598-6c83-1cb2-5763-4ded441403c5@arm.com> Date: Thu, 25 Jun 2020 12:15:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200625074330.13668-3-song.bao.hua@hisilicon.com> Content-Language: en-GB 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: Steve Capper , linuxarm@huawei.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Mike Rapoport , Nicolas Saenz Julienne Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-06-25 08:43, 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 > --- > 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 1e93cfc7c47a..07d4d1fe7983 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -420,6 +420,8 @@ void __init bootmem_init(void) > > arm64_numa_init(); > > + dma_pernuma_cma_reserve(); > + It might be worth putting this after the hugetlb_cma_reserve() call for clarity, since the comment below applies equally to this call too. Robin. > /* > * must be done after arm64_numa_init() which calls numa_init() to > * initialize node_online_map that gets used in hugetlb_cma_reserve() > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel