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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7EAE5C433E0 for ; Thu, 11 Mar 2021 09:05:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D62B64FDA for ; Thu, 11 Mar 2021 09:05:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D62B64FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 765158D029E; Thu, 11 Mar 2021 04:05:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73BED8D028E; Thu, 11 Mar 2021 04:05:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DD5B8D029E; Thu, 11 Mar 2021 04:05:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id 4285C8D028E for ; Thu, 11 Mar 2021 04:05:56 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 06FD2362B for ; Thu, 11 Mar 2021 09:05:56 +0000 (UTC) X-FDA: 77907011112.28.1AD4817 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf24.hostedemail.com (Postfix) with ESMTP id D54A9A0009CD for ; Thu, 11 Mar 2021 09:05:50 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id 18so14065508pfo.6 for ; Thu, 11 Mar 2021 01:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NEuWJ1IzW9w1LR0NVWyqtXThfP/VhN1PD6Tu5Oy4aJU=; b=QiA3e4UOTC6PwCbi+C54OFbkwIRbRlQhWEa7Zi6lg6rbvSsuDTLFVYlZYgUbOQdEow 0Vj3Mk/FnadcKEVMgPih+IquWlvg/pWvvcQE9bv3mKi0TAs02CkadvB5Ai4/1QOmEL8h UuWR228OYb2YtqQ6KBUtmbCz7ojNSbTBmmQTXYAa8YibyX/rIu5fj1whwsLToaQC1p++ l2wfbGX+6k98fxPNNio0d7M8SnD4R5D+fXNkhZkXkxoUwMkHORIe7f54+2cR7IVkeSri m+fOaHETRjK6bCMuihy6y2WnFTbhwwqNHojA9xykcu7jXPBWzaw3hMUH+36nm2zvUMyM n9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NEuWJ1IzW9w1LR0NVWyqtXThfP/VhN1PD6Tu5Oy4aJU=; b=A936ARDUJgZeeshnb30DxWnrvMVLHXViSzAsE7bw1yqnsDvFNVaRES2W5wRuYxAYXe CS8FMLat8ax0X4z1UImJ+Oe59/Ehoym2jszryX58OruerVEabkbz3d393go612h4aeq8 nOgjKnssE5vfKA5Jyst4vRqmuNYsVMykM4vQX4nSyGYx9zH8YTvcrtnkIrvtwpfYiXqC GGymFbyXI93LoZvPmbycWIpbNyROCbIHt9psoVgs2RZhCSyXFaQTVa0hdktHUCXiw+K/ RX3039bVqvFclxG00nr69+g7XCaW/AaYDha/npQdawsAM89lHZFX+dbmAJE+RbwfZMZn 6xmA== X-Gm-Message-State: AOAM533A2KsL7uoNngaqTMgcjZGl80/2qthJpZmksQwyC48J5q91AI9N 8X8p46S0nUSgNtadKtohqueUUw3IdKpPA5nICvojfA== X-Google-Smtp-Source: ABdhPJxfLY17X+FDlSSom02cJEgvIJynJ88BEDZxL6oI/2zyXG78s5f6Q/h0nA9sEvkBon/N6NJyk8LdklhW7UNvJkU= X-Received: by 2002:a63:141e:: with SMTP id u30mr6601246pgl.31.1615453553609; Thu, 11 Mar 2021 01:05:53 -0800 (PST) MIME-Version: 1.0 References: <20210308102807.59745-1-songmuchun@bytedance.com> <20210308102807.59745-2-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Thu, 11 Mar 2021 17:05:15 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v18 1/9] mm: memory_hotplug: factor out bootmem core functions to bootmem_info.c To: Michal Hocko Cc: Jonathan Corbet , Mike Kravetz , Thomas Gleixner , Ingo Molnar , bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , Alexander Viro , Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Oscar Salvador , "Song Bao Hua (Barry Song)" , David Hildenbrand , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Joao Martins , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel , Miaohe Lin , Chen Huang , Bodeddula Balasubramaniam Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D54A9A0009CD X-Stat-Signature: 1x5p97tnhz9iij4xpq7an9ntqwokmqo6 Received-SPF: none (bytedance.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail-pf1-f174.google.com; client-ip=209.85.210.174 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615453550-534189 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 11, 2021 at 4:53 PM Michal Hocko wrote: > > On Thu 11-03-21 16:45:51, Muchun Song wrote: > > On Thu, Mar 11, 2021 at 10:58 AM Muchun Song wrote: > > > > > > On Wed, Mar 10, 2021 at 10:14 PM Michal Hocko wrote: > > > > > > > > [I am sorry for a late review] > > > > > > Thanks for your review. > > > > > > > > > > > On Mon 08-03-21 18:27:59, Muchun Song wrote: > > > > > Move bootmem info registration common API to individual bootmem_info.c. > > > > > And we will use {get,put}_page_bootmem() to initialize the page for the > > > > > vmemmap pages or free the vmemmap pages to buddy in the later patch. > > > > > So move them out of CONFIG_MEMORY_HOTPLUG_SPARSE. This is just code > > > > > movement without any functional change. > > > > > > > > > > Signed-off-by: Muchun Song > > > > > Acked-by: Mike Kravetz > > > > > Reviewed-by: Oscar Salvador > > > > > Reviewed-by: David Hildenbrand > > > > > Reviewed-by: Miaohe Lin > > > > > Tested-by: Chen Huang > > > > > Tested-by: Bodeddula Balasubramaniam > > > > > > > > Separation from memory_hotplug.c is definitely a right step. I am > > > > wondering about the config dependency though > > > > [...] > > > > > diff --git a/mm/Makefile b/mm/Makefile > > > > > index 72227b24a616..daabf86d7da8 100644 > > > > > --- a/mm/Makefile > > > > > +++ b/mm/Makefile > > > > > @@ -83,6 +83,7 @@ obj-$(CONFIG_SLUB) += slub.o > > > > > obj-$(CONFIG_KASAN) += kasan/ > > > > > obj-$(CONFIG_KFENCE) += kfence/ > > > > > obj-$(CONFIG_FAILSLAB) += failslab.o > > > > > +obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o > > > > > > > > I would have expected this would depend on CONFIG_SPARSE. > > > > BOOTMEM_INFO_NODE is really an odd thing to depend on here. There is > > > > some functionality which requires the node info but that can be gated > > > > specifically. Or what is the thinking behind? > > > > I have tried this. And I find that it is better to depend on > > BOOTMEM_INFO_NODE instead of SPARSEMEM. > > > > If we enable SPARSEMEM but disable HAVE_BOOTMEM_INFO_NODE, > > the bootmem_info.c also is compiled. Actually, we do not > > need those functions on other architectures. And these > > functions are also related to bootmem info. So it may be > > more reasonable to depend on BOOTMEM_INFO_NODE. > > Just my thoughts. > > If BOOTMEM_INFO_NODE is disbabled then bootmem_info.c would be > effectivelly only {get,put}_page_bootmem, no? {get,put}_page_bootmem also would be effective. I found that get_page_bootmem is only used in the scope of the CONFIG_BOOTMEM_INFO_NODE. So I move them to the bootmem_info.c. Thanks. > > -- > Michal Hocko > SUSE Labs