Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3357061imm; Sun, 1 Jul 2018 19:34:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLMSGs5d0tzJkYkIdrGusRS05noj25ZiVx3uMZkm9nvHqTb3LRZtQNGzJEQSiUM8nptxK9 X-Received: by 2002:a63:c252:: with SMTP id l18-v6mr17083826pgg.76.1530498871913; Sun, 01 Jul 2018 19:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530498871; cv=none; d=google.com; s=arc-20160816; b=j6LGGRs9SHYlcAX0uej5ZCFklfwcslG6tN7ZW+1A0racF5eyAfz2/w5siSBrAVgg3v Ax1mc3WS1nGAMcQqh5zA8jgjQoEzIhfRw2hZgWta3UnkGpp2eH2f1VOEBH260d/uVfh0 tf5XS8pnlJ7uRoOtzxZBWNfDaYni616McuiNqTFJI2VtNx88f/o93tX5j8M6NjVYcq14 hpSARzalGdnY8t7pL1ofsNytGtpfERY2mSHIfluIdcMXQ1OanGZHeXab4hLCpNy6CTJT Oc3rx0PiFNKMupUPPubTzffBxz8yQFLI4RLtwpasF8tpBz0/h+a2zrKOVd1dqisQoTlY Tyog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=IQArfxmZko62wS7fAPK3LDNuqSIEPl00yPgpD1IcGjk=; b=Dipn2pgzNcFzqaBclrotgM80n/1VM1VkJ52PJv00Mqx1c1lwgO+9NlJwFQVOzwx/+O 6D4oBp5W7WBol5Nk/fdY8U9pgVj1z1vlnPiLSoeW1g9vwuS4rUxy4sQ+Cl+X5YN7enQk CzeUyPFhVIVlZ9w08KBp10wHbOgz+8neVc/qMZFlVYs590p+JYRn3Muy7Pd0dKtpj06T I3fNCj6xQO11+WFIoIbgKf1vwUh4OYc1Q7rjfRIlwdeRkSlPrFnE2YN7XslrGTBhDDM0 Sgg2BPh4UHGvLbEXigB1DnO/rPUNRcr0WhFf+fag/DFbVeFAMt5GMqUaxhDH7EKxQidR VtlA== 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 d18-v6si13022301pgp.214.2018.07.01.19.34.17; Sun, 01 Jul 2018 19:34:31 -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 S1753096AbeGBBwT (ORCPT + 99 others); Sun, 1 Jul 2018 21:52:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33216 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753025AbeGBBwS (ORCPT ); Sun, 1 Jul 2018 21:52:18 -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 47B067C6A9; Mon, 2 Jul 2018 01:52:17 +0000 (UTC) Received: from localhost (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B60EE111DCEE; Mon, 2 Jul 2018 01:52:15 +0000 (UTC) Date: Mon, 2 Jul 2018 09:52:11 +0800 From: Baoquan He To: Pavel Tatashin 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 Subject: Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code Message-ID: <20180702015211.GK3223@MiWiFi-R3L-srv> References: <20180630030944.9335-1-pasha.tatashin@oracle.com> <20180630030944.9335-3-pasha.tatashin@oracle.com> <20180702013918.GJ3223@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) 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.2]); Mon, 02 Jul 2018 01:52:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Jul 2018 01:52:17 +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 On 07/01/18 at 09:46pm, Pavel Tatashin wrote: > ~~~ > > 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. Yes, if they are equal at 501, 'continue' to for loop. If nid is not equal to nid_begin, we execute sparse_init_nid(), here should it be that nid_begin is the current node, nid is next node? > > 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