From patchwork Thu Jun 28 06:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 10493141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 65A71601BE for ; Thu, 28 Jun 2018 06:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55CAA29D95 for ; Thu, 28 Jun 2018 06:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4800D29DA1; Thu, 28 Jun 2018 06:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA5AB29D95 for ; Thu, 28 Jun 2018 06:29:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5BB86B0010; Thu, 28 Jun 2018 02:29:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CE2936B0266; Thu, 28 Jun 2018 02:29:11 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B83FE6B0269; Thu, 28 Jun 2018 02:29:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 8D26E6B0010 for ; Thu, 28 Jun 2018 02:29:11 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id v14-v6so4490597qto.5 for ; Wed, 27 Jun 2018 23:29:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=onfr5gNCmlwbuZj/VrKsvaL8FUFsRzS9LPW8qO3NVpw=; b=fKiXXhH5eSGkjutvda4BINH/VVART3/Xcso9Uf+aVhSwNGPJfJNYv2YBrM5B7div9J C8yG9LIt21jImAK8eUFLR+FLk+W2eHVa+WDpzt30N/c+RW/AVFZDig9Zu6F3xiq2fd52 wJthbeH3CqFjmH+1q1fF1m1mD3q+Hz6s1wSXh7sVjNpcu57I2ABSMzrZdWVgokHOhARx cl5ZvzaWJlq00X0V6Xz53f4S3rsWXltQZqr2/lpE9jHN+7MxmEzlDmWx4Bvqc8F3DvV7 Z6miRi80IOjS9ywLfjP6/LgKIdro4cQ/e/54mOb7F5y53lXgHpYXxcHnmLO04sW8mjaf s44Q== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of bhe@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: APt69E1cA6BPT55acMFrw+YknDxJ+lDDzmcEee4rDiH0nVzQTjEVydlC n+NsjWuPcPvnM5A7Uv4z7Csl+QnE+0+IvRyYIt64XeaNTXh/aFrW9QpX/QxJTn2+lAF4I7cgGLQ z4qVJ/fbh6cPC4dj3lnfVAjkwn3knYd7WpBzYh9NNzYrCwS8ElxtmkIKlfHslyzIFbw== X-Received: by 2002:ac8:37c8:: with SMTP id e8-v6mr6680785qtc.364.1530167351389; Wed, 27 Jun 2018 23:29:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcFvrsEaRiAEaQvYZc2INEGNOeLOQlbeCAyZPD3URrbJWg0SR2D9HosmvgUQfx298/OsYHS X-Received: by 2002:ac8:37c8:: with SMTP id e8-v6mr6680761qtc.364.1530167350786; Wed, 27 Jun 2018 23:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530167350; cv=none; d=google.com; s=arc-20160816; b=xthRuxC1rWuw9bhncUYsUj5vI6JHk+oWeuJ66pNunStNqzuWX17lmIvTcBacnIU+zT LZkRO2t53RPi8sedAjUFPfBm5x1kMbGB7ujHcu0xh2e358DRzYKDJAnunGvzeWJozZqA kU2tYt7hZRg2R3pwPwHHjr+Q4rDkB9mZIf8UxfxTCZM0W9B8yefjCbIUz57Sr4AY1O23 iO9ecsIoVDmLm9yZpUnt1onCFHvgC3nvleYoZSQj8m9vq6m6zg2fybmGtATtjDHNEB91 AQBg22rOzBGDTubysD9HBoZf2QWzvO20iJDsTjJ9i5Uh0tRwFYcr4nbTDReuhgz9mzrl VC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=onfr5gNCmlwbuZj/VrKsvaL8FUFsRzS9LPW8qO3NVpw=; b=k/sQj6aIyzqJ4JKXRm0q9Fhu7mTowX7f4ZR7awM0X1hMHYXisUkLEgMq+cEHuD4onV uvFv6T2nGxXcC43zoZTWZeDuh00JvaK11D+poZibpxoU4G4VHioiK5/58Tz+oxUJ00JK SCwvLtfUvbDRd011sxAPTlEiE+iK5N0pzqDZf6XFsXzcStPzCvt/tgXHWTdvgVifVOpW OHBoiezEk0IEKS2sPY2pmaNXSTwvfEInvcVURTx21/3sRogiNyUXpvw57v5UAQ67diO/ drW/R+zFYUIQKjR6uMLQhsodYPcn2MbBjG04wo90+Hr2h9Rm87LNb1Dn9tCVa0MiHAg8 W+lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of bhe@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id n32-v6si193457qta.356.2018.06.27.23.29.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 23:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of bhe@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of bhe@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7944F8D6AD; Thu, 28 Jun 2018 06:29:10 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 364CB2156880; Thu, 28 Jun 2018 06:29:05 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, pagupta@redhat.com, Pavel Tatashin , Oscar Salvador Cc: linux-mm@kvack.org, kirill.shutemov@linux.intel.com, Baoquan He Subject: [PATCH v6 1/5] mm/sparse: Add a static variable nr_present_sections Date: Thu, 28 Jun 2018 14:28:53 +0800 Message-Id: <20180628062857.29658-2-bhe@redhat.com> In-Reply-To: <20180628062857.29658-1-bhe@redhat.com> References: <20180628062857.29658-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 28 Jun 2018 06:29:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 28 Jun 2018 06:29:10 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' 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: X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- 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++; } } }