Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1576103ybg; Wed, 29 Jul 2020 18:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvrkQUa7BhuwVbL+Os63+cHam+XZeAldMKAsD20NCGGBubWkIAs+lgwZFauyt9IOh7YrBW X-Received: by 2002:a17:906:2b44:: with SMTP id b4mr414237ejg.406.1596074111353; Wed, 29 Jul 2020 18:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596074111; cv=none; d=google.com; s=arc-20160816; b=JIi2jrUSkAU7YlEmr+U1qAUw06kyQipIOjbByst4MXzlTL8sFszR5aoOD1Zb9rNMg1 eHwbKBCZ+U0AzFDQNG3dbFXJBsIcWQEXT97LMdBbGrYgb7uwypW1EUW/B5SY5Rfli6VB qzYbxoymmIF1Wql0c9v2x8FwqmdmyDFu4dRE/861h3lAVoLjhKoJJphkPCyOq20IL2tK og1vTnr75Y+OZixBsqa9oLTmikQGG+K9A5ZtRteWWCmfFQiYEl1U9t5Zl5JIuGL/VIJk m5F+Y6RNM95/TNQF4wAE6uEBSSCA8CZDdTb/hcuR7CYT3NWEKDnnKLwJA0BXy9L6LkKW Nyzg== 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:dkim-signature; bh=RRu2DjMF0v0Jv3loZnZu2suQTSJCldR+3yWZSkhX+qw=; b=NQ1aW4zOvpPTcZC5d9GV8vJ48Y7KtDIFMQYmusU3qyikhQSyRXWLZbh+9D8x1gUMgG 019NV5c59ChTY4oWNZkmTj2hce1NL/GKQ2GLHSpbfkZXJU6ImAGz1K+HUY9W5ov2j03I NK3ywDXFqLIe6yjrR2FxQAfOEftKOK7bjdZHFBm0hnqH//DrywM81PhYp2yiroq3lNzM mX1ZmOuIVia9A70Uih5smUygMJ70bcTaCnTJc6hj98mhgcpxx+kpW1yNbL8veY2SbPYM jhVwTNGILtryYDC6YiA9qJhhyNTwTw4JOxJeohM6/Mc8rBKtqAv6YUBwcsuB4Pxi9F6D wZbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WPEioIaU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc17si2336322edb.392.2020.07.29.18.54.49; Wed, 29 Jul 2020 18:55:11 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WPEioIaU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgG3Byi (ORCPT + 99 others); Wed, 29 Jul 2020 21:54:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51692 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726480AbgG3Byi (ORCPT ); Wed, 29 Jul 2020 21:54:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596074076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RRu2DjMF0v0Jv3loZnZu2suQTSJCldR+3yWZSkhX+qw=; b=WPEioIaUVuT+NXE+mbDAAoYgyszkhwTBNFKCjBxYVVL9b5eej71Tz/jno9YwO9mYf/jKLr xF5DiZFUAsSSwVLtMqCL3P/zxV5aYd+ScBHlGrJoXztQWM4yXS7CeatxRxpszbLrghhZ04 kNLbRDYZUPxM1ZI6kYeq783wR9lAHrQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-MKISxg0TPU6a-4FvLzbZhQ-1; Wed, 29 Jul 2020 21:54:32 -0400 X-MC-Unique: MKISxg0TPU6a-4FvLzbZhQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6832D1005510; Thu, 30 Jul 2020 01:54:27 +0000 (UTC) Received: from localhost (ovpn-12-125.pek2.redhat.com [10.72.12.125]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56EE9619B5; Thu, 30 Jul 2020 01:54:26 +0000 (UTC) Date: Thu, 30 Jul 2020 09:54:24 +0800 From: Baoquan He 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 10/15] memblock: make memblock_debug and related functionality private Message-ID: <20200730015424.GJ14854@MiWiFi-R3L-srv> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-11-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728051153.1590-11-rppt@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/28/20 at 08:11am, Mike Rapoport wrote: > From: Mike Rapoport > > The only user of memblock_dbg() outside memblock was s390 setup code and it > is converted to use pr_debug() instead. > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > of the kernel. > > Signed-off-by: Mike Rapoport > --- > arch/s390/kernel/setup.c | 4 ++-- > include/linux/memblock.h | 12 +----------- > mm/memblock.c | 13 +++++++++++-- > 3 files changed, 14 insertions(+), 15 deletions(-) Nice clean up. Reviewed-by: Baoquan He > > diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c > index 07aa15ba43b3..8b284cf6e199 100644 > --- a/arch/s390/kernel/setup.c > +++ b/arch/s390/kernel/setup.c > @@ -776,8 +776,8 @@ static void __init memblock_add_mem_detect_info(void) > unsigned long start, end; > int i; > > - memblock_dbg("physmem info source: %s (%hhd)\n", > - get_mem_info_source(), mem_detect.info_source); > + pr_debug("physmem info source: %s (%hhd)\n", > + get_mem_info_source(), mem_detect.info_source); > /* keep memblock lists close to the kernel */ > memblock_set_bottom_up(true); > for_each_mem_detect_block(i, &start, &end) { > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index 220b5f0dad42..e6a23b3db696 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -90,7 +90,6 @@ struct memblock { > }; > > extern struct memblock memblock; > -extern int memblock_debug; > > #ifndef CONFIG_ARCH_KEEP_MEMBLOCK > #define __init_memblock __meminit > @@ -102,9 +101,6 @@ void memblock_discard(void); > static inline void memblock_discard(void) {} > #endif > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > - > phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, > phys_addr_t size, phys_addr_t align); > void memblock_allow_resize(void); > @@ -456,13 +452,7 @@ bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size); > bool memblock_is_reserved(phys_addr_t addr); > bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); > > -extern void __memblock_dump_all(void); > - > -static inline void memblock_dump_all(void) > -{ > - if (memblock_debug) > - __memblock_dump_all(); > -} > +void memblock_dump_all(void); > > /** > * memblock_set_current_limit - Set the current allocation limit to allow > diff --git a/mm/memblock.c b/mm/memblock.c > index a5b9b3df81fc..824938849f6d 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -134,7 +134,10 @@ struct memblock memblock __initdata_memblock = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -int memblock_debug __initdata_memblock; > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > + > +static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > static int memblock_can_resize __initdata_memblock; > static int memblock_memory_in_slab __initdata_memblock = 0; > @@ -1919,7 +1922,7 @@ static void __init_memblock memblock_dump(struct memblock_type *type) > } > } > > -void __init_memblock __memblock_dump_all(void) > +static void __init_memblock __memblock_dump_all(void) > { > pr_info("MEMBLOCK configuration:\n"); > pr_info(" memory size = %pa reserved size = %pa\n", > @@ -1933,6 +1936,12 @@ void __init_memblock __memblock_dump_all(void) > #endif > } > > +void __init_memblock memblock_dump_all(void) > +{ > + if (memblock_debug) > + __memblock_dump_all(); > +} > + > void __init memblock_allow_resize(void) > { > memblock_can_resize = 1; > -- > 2.26.2 > >