Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7114890imm; Wed, 27 Jun 2018 20:43:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLxGN3CU8sg2tDjyCdOzwhM2rG2K3o5DrP7gGc6WvpW6MuIE2r6MR/FemLEny71nrXYL/nW X-Received: by 2002:a63:6849:: with SMTP id d70-v6mr7203455pgc.7.1530157426130; Wed, 27 Jun 2018 20:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530157426; cv=none; d=google.com; s=arc-20160816; b=NSWm1TYd6DK/egshY9Mz5+E7VyhJFqLBB8+ggwXvpIrIwxSqzX9FgrnXPByNgdXIF/ PSHTbzdwMuVXGWatjeTcfAGM6eOQxG9lABnklbNqpiNwSYeKBVdKovv9X24pYQ7QxHWu Orcuqj+0x50wa8Gd3RXU5DOOwknRU7ToqvGh4ms/JsMPdzqH9jOSOsuFL4GWbSIuzwzs UEOEtNeIceB1jmjBE2Bjh+I4p+o3bLTPjQzP8hFpKVtmqe33/YRgYJqXT5X9Z0SGGLmV qjNDfmK4njAel11PaGpxbi7Ac/0LyYVlF3SBDXvcHX30RCz7iJKqtfl7jBjXgDU2/bhg CfOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=JcYgWyk5JGBCoK/+mIb+Pv+xD0h8a+UXWDZAJ6JKwz4=; b=TIGiHK4BRNugNHXLh40J65DV19M9We6reKFzGcABAtnCv5sH8xdrFcW7FxQqFdDqOj YkmlzQVklr/0QZ008HnX1A+aOPpb6Tq+lf53IGUkO1nJIvnBpy0GcugLJulMVb/GYWpb npClMZjuXGeC4WGO7aI93IbvzngYidRBU7MlflWl9dS9or+l3zw6mjtnrE1mXnY1Fugh L778eAmkuIN6ZACCbCGTbmQeyH38QwnB2X5WNw2UyjfGYXDTAdlhTQONYrPYXiLRWA5o D8qDV0YJvf/qw0XnWjLBtILkoeIdGMLVWvB5nJZN9+MYL0K0scmt71KuBI742Tm/C5J2 2uDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=HVmje7+b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2-v6si4615607pgv.575.2018.06.27.20.43.31; Wed, 27 Jun 2018 20:43:46 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=HVmje7+b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130AbeF1DLU (ORCPT + 99 others); Wed, 27 Jun 2018 23:11:20 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:43136 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbeF1DLT (ORCPT ); Wed, 27 Jun 2018 23:11:19 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5S38io2088192 for ; Thu, 28 Jun 2018 03:11:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2017-10-26; bh=JcYgWyk5JGBCoK/+mIb+Pv+xD0h8a+UXWDZAJ6JKwz4=; b=HVmje7+bFsA23wNMeLnZRPEFXHc7MrHVpkuJTuFp/Fa+7vhcfwSY4RSkIrqEUuAQw8Dv ogHXuUQ6akXMs8P6fF+qzVCDza8j++NwCT4Z98P3oXY5Olc1EoVD9fZxsHji3sBS245N yxHqoL+P4vZEaGZXKbNd5G2+ACa0fFZBmwSe2uUCEEgvU9Y7w1YUwY35XZ8rLBVH1tqH lTScEkyU4MMIqxHG/TYyDEP+jW6DZ2h6ybOrOjdCBGruXlQtJ6YyQlbGVD9ca3/EMKZe S+IOJfznIgP5A/nsEWLEMu2KL2gPJiV7AjAR/sezsqW/PkRy1kwGppsG23+VpDFBP8jD mA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2jum0a7k3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 28 Jun 2018 03:11:18 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5S3BHE4009646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 28 Jun 2018 03:11:18 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5S3BH0c021147 for ; Thu, 28 Jun 2018 03:11:17 GMT Received: from mail-oi0-f44.google.com (/209.85.218.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 27 Jun 2018 20:11:17 -0700 Received: by mail-oi0-f44.google.com with SMTP id c2-v6so3831330oic.1 for ; Wed, 27 Jun 2018 20:11:17 -0700 (PDT) X-Gm-Message-State: APt69E0e81uV+2q7lpKjNv3pQ0IhRytq6jCvhvItSaU+hWwrpCjgENuZ DRL4iVjDx9NGnDih1JMhkTwF1RAnuVPL57ntlZ0= X-Received: by 2002:aca:3b09:: with SMTP id i9-v6mr5047345oia.156.1530155476933; Wed, 27 Jun 2018 20:11:16 -0700 (PDT) MIME-Version: 1.0 References: <20180627013116.12411-1-bhe@redhat.com> <20180627013116.12411-2-bhe@redhat.com> In-Reply-To: <20180627013116.12411-2-bhe@redhat.com> From: Pavel Tatashin Date: Wed, 27 Jun 2018 23:10:41 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 1/4] mm/sparse: Add a static variable nr_present_sections To: bhe@redhat.com Cc: LKML , Andrew Morton , dave.hansen@intel.com, pagupta@redhat.com, Linux Memory Management List , kirill.shutemov@linux.intel.com Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8937 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=760 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806280031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Pavel Tatashin On Tue, Jun 26, 2018 at 9:31 PM Baoquan He wrote: > > 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 >