From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id E377E6B0006 for ; Mon, 21 May 2018 06:16:08 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id m22-v6so2685142qkk.22 for ; Mon, 21 May 2018 03:16:08 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id k187-v6si2073108qkf.39.2018.05.21.03.16.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 03:16:08 -0700 (PDT) From: Baoquan He Subject: [PATCH v4 1/4] mm/sparse: Add a static variable nr_present_sections Date: Mon, 21 May 2018 18:15:52 +0800 Message-Id: <20180521101555.25610-2-bhe@redhat.com> In-Reply-To: <20180521101555.25610-1-bhe@redhat.com> References: <20180521101555.25610-1-bhe@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, pagupta@redhat.com Cc: linux-mm@kvack.org, kirill.shutemov@linux.intel.com, Baoquan He It's used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Signed-off-by: Baoquan He --- mm/sparse.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 62eef264a7bd..48cf7b7982e2 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -202,6 +202,12 @@ static inline int next_present_section_nr(int section_nr) (section_nr <= __highest_present_section_nr)); \ section_nr = next_present_section_nr(section_nr)) +/* + * Record how many memory sections are marked as present + * during system bootup. + */ +static int __initdata nr_present_sections; + /* Record a memory area against a node. */ void __init memory_present(int nid, unsigned long start, unsigned long end) { @@ -231,6 +237,7 @@ void __init memory_present(int nid, unsigned long start, unsigned long end) ms->section_mem_map = sparse_encode_early_nid(nid) | SECTION_IS_ONLINE; section_mark_present(ms); + nr_present_sections++; } } } -- 2.13.6