Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5828976imm; Tue, 26 Jun 2018 19:46:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLAtaDywODFrroHftgnS8tHOp4nXdpXFMd8Bxrdt7jd7vUtwwnRY3Fs7cajfuyE1ZQaBqgN X-Received: by 2002:a63:6e0a:: with SMTP id j10-v6mr3527277pgc.321.1530067581408; Tue, 26 Jun 2018 19:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530067581; cv=none; d=google.com; s=arc-20160816; b=J8ZLEnXwhOxF+IYuCpTg6+tGlyYiJEXgs4+Ax9sYqiTr/UjMCOYp8mRC/+bEsdG9Wg 0zGbrPl3NBxAF9ma6PslHxWEwMMzYv3DlpA+AKlOXlTvliLvFuIfFqA9GqUaQbY8Y65P XDxxz0PoenHhyo/yGFxZGd5ubmPzlDBszIts9dawwKIdoBuWAM6v2aPbUwf1/+wbSE88 bGNVBwuMk0hYFjJ6ODgD/x/NMEc5Q2CNq9mWKatIQiTrQ6T7Fn67RA+maoxWy7S9kUNh Rr7rgge31mXm/EXj8/7t6wlxOQqFWAlypfBdkDnx22WmpvnOlAk/NwlDqV4tt9YJnB2m 4YHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=zelvCbrny18NqAphV5w9BKm6ZXW9Og5Uk0o1PRHyCdc=; b=OWBg8ylz/AWsBKi3eQsgtikh+Bhmz96WLnHU3PJPyISl4sqlaShDusWik+G1s8ZOR8 jdSBVi9yEdGvKivEwKK1l3IoW+58VGdPHpFuRyDhrKDOh7PWpht8TtG/RZ43HrEghiDK mAifYXZzJMQ6tffQc8aDhZyQRcrZZiD38FTXYQOlA8IJyhDCPX4J50lZmgQNBVNcrJcK e5BasHsPOCkyobr9f7nbW9EmQCNS4p1UzdV++NTkKAZVwsD5Jv11eaStPxgBkf1yP+iu uwxhATWhpY6dRPtxHhNw6XFGCCY6HHwnhj7ky5qllqO3UWEyFH9KwDp3US0c7lLCUBlQ xWjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n187-v6si2548661pgn.368.2018.06.26.19.46.07; Tue, 26 Jun 2018 19:46:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964912AbeF0BcY (ORCPT + 99 others); Tue, 26 Jun 2018 21:32:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39172 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755316AbeF0Bb3 (ORCPT ); Tue, 26 Jun 2018 21:31:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 22CB8400B455; Wed, 27 Jun 2018 01:31:29 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-8-24.pek2.redhat.com [10.72.8.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A68C111764C; Wed, 27 Jun 2018 01:31:25 +0000 (UTC) From: Baoquan He 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 Subject: [PATCH v5 1/4] mm/sparse: Add a static variable nr_present_sections Date: Wed, 27 Jun 2018 09:31:13 +0800 Message-Id: <20180627013116.12411-2-bhe@redhat.com> In-Reply-To: <20180627013116.12411-1-bhe@redhat.com> References: <20180627013116.12411-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 27 Jun 2018 01:31:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 27 Jun 2018 01:31:29 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 f13f2723950a..6314303130b0 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,6 +200,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) { @@ -229,6 +235,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