Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp365287pxa; Fri, 21 Aug 2020 09:11:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnWYGu26yORKu+3W2WdH9+uaZsoVwBmUPd3Nn1IfmPVwdJ6LofRHkWE0bs2961N+AvBSyD X-Received: by 2002:a05:6402:a59:: with SMTP id bt25mr3578236edb.71.1598026311569; Fri, 21 Aug 2020 09:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598026311; cv=none; d=google.com; s=arc-20160816; b=WHg3f6AJbw0SbhefgG9LB/W06p19wFUBidiVTXMFANHUp2rBbVToRdneMhHjYZ0+9B ctSqvCcZcWk7LVZlOXgJuuzoTHOiAbW01bf4xE28FQYSu9TxuV4+7TJWkHZvwoI/PdVE JNtZRQcSPajwzNAnkVaTd8GTbKVUOGpumZYyZzLG/epMjtqyfpNIfMXzJholIpBcgYmr 6XLMeIdSopYTOl1VQECyxP5HfzHy8ciT6Hr5mpfewDrsiixkPoxDHgYURyCNDZ3AQJS9 quddv53UENwmo1J2Jnu/rHO28NDz7Zi5wFU3utQRgVFNBoG+f8yldMe350YU53SL150X 8BSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=92eGX7MWPFjNhNX0NwOjIQ0sXPTJuWVAoSzAi/Jj5GU=; b=q/wCG6vQgzN/g7MnjuqxRKiI+SoAMRsve1LBdhcttGf4FRRnHbDWIq6Y2mNa4UBa16 ZM1DLElpJ/jiNHB3JtsD0KdQAVxV/TVy3/qhmBARKgDMxeUiLRZFGILHGll9r+t2yhSh XoMvHhCoMUyHVKSaistNCHsvhMMdcEr5KFLYrUmyyBvldogErcInW9GcxtJ6sD93/st2 XvVNTBJk2VnJQlFddrkiDI9bdrYtxF4ps5xecaN8LvyaWZa5A5T2eiCManCIP3d7o650 UVTMFvHyRptmDeK94CaYzT2zG6s1/K+Iq8x10UPsr/pkqYtAL/0f2FLpzEis5NH6v8b7 mvxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=stlLywnR; 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 c27si1475478edx.64.2020.08.21.09.11.27; Fri, 21 Aug 2020 09:11:51 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=stlLywnR; 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 S1726176AbgHUQI4 (ORCPT + 99 others); Fri, 21 Aug 2020 12:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgHUQIy (ORCPT ); Fri, 21 Aug 2020 12:08:54 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45035C061573 for ; Fri, 21 Aug 2020 09:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=92eGX7MWPFjNhNX0NwOjIQ0sXPTJuWVAoSzAi/Jj5GU=; b=stlLywnRrzvVM8oQQ81BQX97tc cRayqTje0CRor0HOVRUn7EC+cQ/7O1TMj1OOKxZDR0omMH/aQqEvVDAh6SXszeOP+xvxBP8DDMeia dnZ1t21/MLZMFd45JqtPIJPAn7xB0OJ1EMbL58yh+Z+XJeMpAgURfPejkTYuWVIgd2oAWwY4WNRq/ bMQpDiNUWJd1xlFXIVTYv8kPJgdBzqPdmZoH5v1fgooiiS7525CSYfCCMMlSTFVVVH7OI08lDKbuv 0vVC9slIupv6+m6PhqQluAwZ73GTqBg5V6VQ1dYcgCH9OI6TmK/joa7RqwzWJWt5WR7Iyn+Z+qlPa 1ifE+dyA==; Received: from [2601:1c0:6280:3f0::19c2] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k99ai-0007DH-IK; Fri, 21 Aug 2020 16:08:32 +0000 Subject: Re: [PATCH v7 1/3] dma-contiguous: provide the ability to reserve per-numa CMA To: Barry Song , hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, will@kernel.org, ganapatrao.kulkarni@cavium.com, catalin.marinas@arm.com, akpm@linux-foundation.org Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, prime.zeng@hisilicon.com, huangdaode@huawei.com, linuxarm@huawei.com, Jonathan Cameron , Nicolas Saenz Julienne , Steve Capper , Mike Rapoport References: <20200821113355.6140-1-song.bao.hua@hisilicon.com> <20200821113355.6140-2-song.bao.hua@hisilicon.com> From: Randy Dunlap Message-ID: <5eafce91-cc92-e6ed-23b0-98f253129e1b@infradead.org> Date: Fri, 21 Aug 2020 09:08:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200821113355.6140-2-song.bao.hua@hisilicon.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/21/20 4:33 AM, Barry Song wrote: > --- > -v7: with respect to Will's comments > * move to use for_each_online_node > * add description if users don't specify pernuma_cma > * provide default value for CONFIG_DMA_PERNUMA_CMA > > .../admin-guide/kernel-parameters.txt | 11 ++ > include/linux/dma-contiguous.h | 6 ++ > kernel/dma/Kconfig | 11 ++ > kernel/dma/contiguous.c | 100 ++++++++++++++++-- > 4 files changed, 118 insertions(+), 10 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index bdc1f33fd3d1..c609527fc35a 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -599,6 +599,17 @@ > altogether. For more information, see > include/linux/dma-contiguous.h > > + pernuma_cma=nn[MG] > + [ARM64,KNL] > + Sets the size of kernel per-numa memory area for > + contiguous memory allocations. A value of 0 disables > + per-numa CMA altogether. And If this option is not > + specificed, the default value is 0. > + With per-numa CMA enabled, DMA users on node nid will > + first try to allocate buffer from the pernuma area > + which is located in node nid, if the allocation fails, > + they will fallback to the global default memory area. > + Entries in kernel-parameters.txt are supposed to be in alphabetical order but this one is not. If you want to keep it near the cma= entry, you can rename it like Mike suggested. Otherwise it needs to be moved. > cmo_free_hint= [PPC] Format: { yes | no } > Specify whether pages are marked as being inactive > when they are freed. This is used in CMO environments -- ~Randy