Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp195850ybi; Tue, 18 Jun 2019 20:42:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxt/jIftCoYMpRyhEnLHkvZWLLGxomlNnnBYGgpCORVSMgMPrgk10/JSSjpduN99wX7JDK X-Received: by 2002:a62:ab18:: with SMTP id p24mr2394225pff.113.1560915727669; Tue, 18 Jun 2019 20:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560915727; cv=none; d=google.com; s=arc-20160816; b=Jax4aDpsfaOiIUoncZtmclh93e6zxCIBy8i59kn6lR31D95r/EGdeIx3DEeaFM6jsb rfb63jq5AwYFUjd6vhbK22IBJjTdAnU8OCceqG8te1tpAXfNlQ8MSp2osNAFAKRk+Xj6 Iwz/MNf/UlPMQltaC/LYLAbVW/oMGVFtYNiglBtmOWaAr53b5F9NIdh2H/7jF4q7ScT9 usMKJfML5GWdMo0d2mOgMoOyBu/kxmOcNHMN+ry0I4oJ8nmiJkk7xpj1IInTedqQ3Tnq puDAQHPsHtuyES5Kpw60o8gqbl+1BuiWmWEKXB0Ifih2YjmvSOOn1KXm5coZCT2lLk60 UzoQ== 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; bh=4V43vNNP9UR/YMy0iUrU7kUuUwSqcmG602S5hpOD5NE=; b=DeisTlcnWaPFFCwbeKdgk95s0BAwYKPcTME2OqELdp1s8x8ecQN2Xk5fFdga7mWLOD WV6Kw3YR+k56Vp/70ufHZVQvNKuzMsNqxXUEO7oS8ys8AxESHR0OZeNUke44eoymC//W 8hiO1+4i7Ret/V6meGTxRZey3GcJj8pyWFLbBk4IiRgh3XGXA5LvFXI4KCHhu3BvklFu RFfGR3u3LFcr/51UKJpNJ3IDrnI+mwg0eSUGlvTMTqDtuPUKGKGWJGSHA8GCDvaA6qxh aJ4W9Dm9iSeOcLsLjefroWwyyqPTrUnPltlCZSonnKPqPvQLPPgEwVt6eK7d9H0Yq8eB pjDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=BQ7vWgHm; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si141302pjr.109.2019.06.18.20.41.51; Tue, 18 Jun 2019 20:42:07 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=BQ7vWgHm; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730358AbfFSDks (ORCPT + 99 others); Tue, 18 Jun 2019 23:40:48 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42182 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfFSDkr (ORCPT ); Tue, 18 Jun 2019 23:40:47 -0400 Received: by mail-ot1-f65.google.com with SMTP id l15so8167014otn.9 for ; Tue, 18 Jun 2019 20:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4V43vNNP9UR/YMy0iUrU7kUuUwSqcmG602S5hpOD5NE=; b=BQ7vWgHmVXoWfX5W8xsL12ik15mXugB0SaJil+xQI3I0WxyylMDSZVjeFIBqrMpPVJ Tgiut3d49qvcxdiNlr/Wuqhf5OYmZDTD6pJsL4uc8B7AvZ8wwh8aPM4n71HSolE5Oxc3 FA9Ld6qDcf1gl5dm9y3qsfehBHljHi5HXuDdd7/icxI+t/oHdrlAmeDiUP/Kmr+DiaXd ygMke+1L3EJ6jv6Or7J7ka07JnJyzYJ6usnlq/hrYPaTv2PCenHPThlG9fXMEyQo3ktq qYnDyLZfzEglV0V7mhDK4JYNDdtBeedbRy3nXiodLZw2O63uvgAs/frjTUrFddu2fdwk 1G9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4V43vNNP9UR/YMy0iUrU7kUuUwSqcmG602S5hpOD5NE=; b=dwBQUrE388OR7Xd2VnsBEZpCs+CwEDv/D7I/j2BCS/3YbpyfZ3d8h/uZ5OTuQPVvXX szspdalK3RYkncrWc+ikJgyGDdk8OEYo8Y6LGdDl17VKvUucIiEL13nWrp/nFGlodFFO fOcGQfjvXkWzC7SgweVJ4XSv21QpMs55fzsYzibVtPwq5lf1KAwam9Fjd2xTeE8H5msE HjnKEc8LbesDtpW7PXh8yeeHEJEyPlU9z8x2v8yB9OXtVlQNRMElfw0kcZNq7tyQoroZ R1d37x+BDAl2qJXURhlvL1ZClrTZyBeYem4UVaub3guojyydrFCOgxyc5I88XAtG9/Xm Q9vg== X-Gm-Message-State: APjAAAXxAEDgCCyKcrwnpPEANpyrnJ1iWIDGwBRFQ/Xq0Li9bw1xElpE sC7UcGkYyNAz/X22kzUGUMLKBpHfJq9IqOKDgHtgNQ== X-Received: by 2002:a9d:7a9a:: with SMTP id l26mr59223453otn.71.1560915647227; Tue, 18 Jun 2019 20:40:47 -0700 (PDT) MIME-Version: 1.0 References: <155977186863.2443951.9036044808311959913.stgit@dwillia2-desk3.amr.corp.intel.com> <155977188458.2443951.9573565800736334460.stgit@dwillia2-desk3.amr.corp.intel.com> <20190618014223.GD18161@richard> In-Reply-To: <20190618014223.GD18161@richard> From: Dan Williams Date: Tue, 18 Jun 2019 20:40:36 -0700 Message-ID: Subject: Re: [PATCH v9 03/12] mm/hotplug: Prepare shrink_{zone, pgdat}_span for sub-section removal To: Wei Yang Cc: Andrew Morton , Michal Hocko , Pavel Tatashin , linux-nvdimm , Linux Kernel Mailing List , Linux MM , Vlastimil Babka , Oscar Salvador Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 6:42 PM Wei Yang wrote: > > On Wed, Jun 05, 2019 at 02:58:04PM -0700, Dan Williams wrote: > >Sub-section hotplug support reduces the unit of operation of hotplug > >from section-sized-units (PAGES_PER_SECTION) to sub-section-sized units > >(PAGES_PER_SUBSECTION). Teach shrink_{zone,pgdat}_span() to consider > >PAGES_PER_SUBSECTION boundaries as the points where pfn_valid(), not > >valid_section(), can toggle. > > > >Cc: Michal Hocko > >Cc: Vlastimil Babka > >Cc: Logan Gunthorpe > >Reviewed-by: Pavel Tatashin > >Reviewed-by: Oscar Salvador > >Signed-off-by: Dan Williams > >--- > > mm/memory_hotplug.c | 29 ++++++++--------------------- > > 1 file changed, 8 insertions(+), 21 deletions(-) > > > >diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > >index 7b963c2d3a0d..647859a1d119 100644 > >--- a/mm/memory_hotplug.c > >+++ b/mm/memory_hotplug.c > >@@ -318,12 +318,8 @@ static unsigned long find_smallest_section_pfn(int nid, struct zone *zone, > > unsigned long start_pfn, > > unsigned long end_pfn) > > { > >- struct mem_section *ms; > >- > >- for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SECTION) { > >- ms = __pfn_to_section(start_pfn); > >- > >- if (unlikely(!valid_section(ms))) > >+ for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SUBSECTION) { > >+ if (unlikely(!pfn_valid(start_pfn))) > > continue; > > Hmm, we change the granularity of valid section from SECTION to SUBSECTION. > But we didn't change the granularity of node id and zone information. > > For example, we found the node id of a pfn mismatch, we can skip the whole > section instead of a subsection. > > Maybe this is not a big deal. I don't see a problem.