Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp68018ybg; Mon, 27 Jul 2020 23:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZtoYxGgHvXuNogFjQQfPz+T7De8vw07S3J496aI6rmFAjG+jMzE9/+OK/8oImGrWhjYfd X-Received: by 2002:a50:d75e:: with SMTP id i30mr98620edj.246.1595918473274; Mon, 27 Jul 2020 23:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595918473; cv=none; d=google.com; s=arc-20160816; b=I3WQ9F78CcfiGwUGmokVtzCjLPvosZgX6cg3coyDIyXYgRhaP276toXKfrx+CEXWkJ WXWXUrByu693gd9Xwiati2eDVQg6+NuOVoAj3oMF/UrI4eww5dwh8o4Rh6UlT/rnSjlK dTnRQ1TWfbhJEHNkM29Cdbhza3JJuray2fjOvYslkpKgOXSBsP5ar27e2+RVkZ12Wqpv gGF7+AhG6UMdqhg0/dKfqeK6UzUheJLXbhJPrHoK/I/8uE/tjEF/5zBIbg6xOSEKvvaI kSrFMrFdyZ1R3FY/qTHRFkMcuHgGLocsFM39prcB2GLlmCyQx6E4GSklY3eK/yM6jd1M jvLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wNSflOIjAgsFGMCnqoKTEaq+9byArCm29H+sqsXcP0s=; b=IMdGRhpnK9LsK/K8tEdvfORgEi3invhKAqQOvzFucerVNm1CUdQDGpjo1WNWeQoAx9 MYQyXm4SUUvea4kjPb3Ege+gGhmQsbyrOVp/9bZxJJBTcYIFbCFjBBfT/TZ5pJ/TgzI2 65Zu07nkeTVRM/QNLjPlJ7qXrCXEYJT00jMWjDvNXmjI3p6kUVxSDQLbb4qaQS3Bq6Z2 TjgBwbOYpv6UIiUZBISJImmhyNTbnDlWReEnw6WUE8+a6qZfWJVFlU1KKjGbVmmUOMem AeQL/YxYuMdnOLZigCJaOWW7r1UXptv7e25RyT0QldXLIJdusv/GQkq35CVqRmjZF9gR vkfA== 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 d25si4292969ejc.287.2020.07.27.23.40.51; Mon, 27 Jul 2020 23:41:13 -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 S1728176AbgG1Gh4 (ORCPT + 99 others); Tue, 28 Jul 2020 02:37:56 -0400 Received: from verein.lst.de ([213.95.11.211]:46850 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgG1Gh4 (ORCPT ); Tue, 28 Jul 2020 02:37:56 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id EF4D868B05; Tue, 28 Jul 2020 08:37:49 +0200 (CEST) Date: Tue, 28 Jul 2020 08:37:49 +0200 From: Christoph Hellwig To: Mike Rapoport Cc: Andrew Morton , Andy Lutomirski , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Dave Hansen , Ingo Molnar , Marek Szyprowski , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Stafford Horne , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org Subject: Re: [PATCH 02/15] dma-contiguous: simplify cma_early_percent_memory() Message-ID: <20200728063749.GA21221@lst.de> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-3-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728051153.1590-3-rppt@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 28, 2020 at 08:11:40AM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > The memory size calculation in cma_early_percent_memory() traverses > memblock.memory rather than simply call memblock_phys_mem_size(). The > comment in that function suggests that at some point there should have been > call to memblock_analyze() before memblock_phys_mem_size() could be used. > As of now, there is no memblock_analyze() at all and > memblock_phys_mem_size() can be used as soon as cold-plug memory is > registerd with memblock. > > Replace loop over memblock.memory with a call to memblock_phys_mem_size(). > > Signed-off-by: Mike Rapoport Looks good: Reviewed-by: Christoph Hellwig