Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3331688imm; Sun, 1 Jul 2018 18:51:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcoxKe9pROW4xwS82ayaYWO2O3/nfwDfgInx77BkGeq8+f0N22wTWL+DI4GIO9HrQRvV8mo X-Received: by 2002:a65:65c6:: with SMTP id y6-v6mr17364013pgv.20.1530496261849; Sun, 01 Jul 2018 18:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530496261; cv=none; d=google.com; s=arc-20160816; b=g/N0NiQ/jJGGYf2zDODKclrDc62Yj+LH8dzeDqObrzVkqadhA9ndAf3H+EYoSEUF8n dxnzJSz46rl6lcS5eKQ7gUrismsvloHFttlPIVU7Qc9IBQE0jFBV0Mfc00hBn32tRv2m x+EsxphA7MtLPeggPxmaCZ3WQAzfP7SLoEVSkddclq+JuCxikCMHjUTGoN4eyBm5+RSb Nx/xv0xS23DMrvHg608jHbToSbtaI76z23AkFGkLUe105mBniTdMi+snNwTszeqfD22D ZkDFTscGT/jo20NDkzzc9MJjs29KmSaZ0/0LLNRJqf3Wm1EDT0r9UtsQmM7C36u9Pm87 r+Uw== 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=y8XvfoLQxeCtX3IAjo4PNYBj7Ynlit0T2YPyfqfqn38=; b=hj2iDGPD+viRM4UDLx2uqi67+IpX5xj6hyhXMn52jrKYoReZrsE4F/quanT3Dutxex MoQsTEL0EimOhCAfXSYlCQ7S6r9XXAtaJ2DTclfM2pd5FgJ0wth1APlbiQTDPLs/v7Go 5wXwKFMOEmvQm2flL2m5koqEg0X5FWPWJM1pVdiYJ3Fkl/fNW8VwPbOxJqa/2CIZ4Xq+ HIMrPqaGzqZlnM+J1zoU+aqdzqlKIVsqqrADBSjcnyaWZsmd66f/1nqqglA/SJejnLS0 uheCY5WJMBGly9NsULItC+e+HkQkgiKrxnImQcAmlBy6tUsKJvH3cCwmCFdIFYRxonz9 KG5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=GRu9SfUm; 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 t189-v6si14093037pgb.440.2018.07.01.18.50.47; Sun, 01 Jul 2018 18:51:01 -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=GRu9SfUm; 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 S932790AbeGBBrT (ORCPT + 99 others); Sun, 1 Jul 2018 21:47:19 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:59082 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932477AbeGBBrQ (ORCPT ); Sun, 1 Jul 2018 21:47:16 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w621ivoW092960 for ; Mon, 2 Jul 2018 01:47:15 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=y8XvfoLQxeCtX3IAjo4PNYBj7Ynlit0T2YPyfqfqn38=; b=GRu9SfUmS4pwuHyZmolCvbSqihWraICc4XNQUlxbHYDoT5W7KZq9sZViKwZVoljnq2FM 8rxcX0sVbeU3LpFC2afFML2LEU/ZlDSaOzHfdvfPxgDlW8XBOe5FSuNjXjzP2sG/aD5E mIwk/O8Za+ZWMzcmew+a6HW2ZuxoWCKGKycjTIui3ykZU602AODvqLaYYSsER9kLJXZM Y78PoAHHrILRhF/UJ6jB8Fi7PJ9GzpfYn8OiNTXRbyV5bakAHBOB9gWz99Wdk3TYwkL1 O0BgNNp7LkYClNYBHCaUsHkaXT1GTTM5Dl/TFd86/CIa0iPkaz2otR0wX+5GWWCJjXFg sw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2jwyccjpaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 02 Jul 2018 01:47:15 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w621lDHl003072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Jul 2018 01:47:13 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w621lDqO028847 for ; Mon, 2 Jul 2018 01:47:13 GMT Received: from mail-oi0-f41.google.com (/209.85.218.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 01 Jul 2018 18:47:13 -0700 Received: by mail-oi0-f41.google.com with SMTP id k81-v6so13471677oib.4 for ; Sun, 01 Jul 2018 18:47:12 -0700 (PDT) X-Gm-Message-State: APt69E2tspvC/Hbq3l3skU+fzQ8Nz7Z9MKIVtxkL+SR/9Xc7oshzPRgz DC5Vi5W+EZgBdIsiK7eiuTPsq1RIBLp8p6It2Po= X-Received: by 2002:aca:e5d2:: with SMTP id c201-v6mr14396746oih.191.1530496032380; Sun, 01 Jul 2018 18:47:12 -0700 (PDT) MIME-Version: 1.0 References: <20180630030944.9335-1-pasha.tatashin@oracle.com> <20180630030944.9335-3-pasha.tatashin@oracle.com> <20180702013918.GJ3223@MiWiFi-R3L-srv> In-Reply-To: <20180702013918.GJ3223@MiWiFi-R3L-srv> From: Pavel Tatashin Date: Sun, 1 Jul 2018 21:46:36 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code To: bhe@redhat.com Cc: Steven Sistare , Daniel Jordan , LKML , Andrew Morton , kirill.shutemov@linux.intel.com, Michal Hocko , Linux Memory Management List , dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, Souptick Joarder , gregkh@linuxfoundation.org, Vlastimil Babka , Wei Yang , dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, osalvador@techadventures.net Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8941 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=887 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807020019 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ~~~ > Here, node id passed to sparse_init_nid() should be 'nid_begin', but not > 'nid'. When you found out the current section's 'nid' is diferent than > 'nid_begin', handle node 'nid_begin', then start to next node 'nid'. Thank you for reviewing this work. Here nid equals to nid_begin: See, "if" at 501, and this call is at 505. 492 void __init sparse_init(void) 493 { 494 unsigned long pnum_begin = first_present_section_nr(); 495 int nid_begin = sparse_early_nid(__nr_to_section(pnum_begin)); 496 unsigned long pnum_end, map_count = 1; 497 498 for_each_present_section_nr(pnum_begin + 1, pnum_end) { 499 int nid = sparse_early_nid(__nr_to_section(pnum_end)); 500 501 if (nid == nid_begin) { 502 map_count++; 503 continue; 504 } 505 sparse_init_nid(nid, pnum_begin, pnum_end, map_count); 506 nid_begin = nid; 507 pnum_begin = pnum_end; 508 map_count = 1; 509 } 510 sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count); 511 vmemmap_populate_print_last(); 512 } Thank you, Pavel