Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp485003ybv; Fri, 7 Feb 2020 03:07:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxuhq+xgv2ZWut7ZZGkfgU+V+nToksAd71dOTvvOAb3+6oGjClpuZA7YUuP+9+LVer0IyV8 X-Received: by 2002:aca:4789:: with SMTP id u131mr1614821oia.43.1581073671166; Fri, 07 Feb 2020 03:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581073671; cv=none; d=google.com; s=arc-20160816; b=DnnRc+kkh097BOJV1cFXsjaJqZ+PLzp1pmr7ZoGeqD1hO851r6DnJYdNFYPc/J/LXO hbYYGvmYI8ycIn1UOY0p2gXeSJd8HCPxN99LW85+pZ2cYWJEPVUJsXjjmip12MskZenI Tj1V4X99fYXJ+MDwMo+RIaLAtsuM5BrGgskxGFQu7VGX2wcsZW2ZYpohAEPDR7Dksbjw 8faHOhYCypbsnqMss70w0y9wsZ0MDcRE9YdnfHy2j8ygsrzBAV6jzxT8gfE/Zj8howYn lmJh8GJQmmZyazaHEhGHgbFbm7ffxnkaybQFZ+n1TBYqChEKfG/oU7hJs2OVnw13DvbF C2kA== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=zMsp4UuAC/b8KhB/mSZIHIFY0+hSXiMGCvZikBQPSDs=; b=NkkDSRaBieRFETOVCjUNxApsWQCAB9fScwL4sz6v03RTKQGA6Rh2gjkGtZAB/5AcLv 1jIc5V4VndwH2dn6St5E/nhSlDR15VnAAut5qDu6oXZ12GXEWZcnbczIXneiejbE3N+k yHqexh9buE6arapnlXtEbuRJ7SaXZSKZ/5Jm8NeGv/dbXn+5YyDOm7ajdEnqIoXTjBcT zOmw0sqAjZRU5ZQpDTcj3TC9B/kzxwnvkzL0WmB643r9xT9W8fjG95wSDvp796xCiJoF qsJSZi73qJBfMcwNRJqic3SeGo04C3qZpgJvj5/Q9xg2iAhu627/kjTOabhiJSpSctwH ONJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AlQ+VhSS; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si3513151oie.193.2020.02.07.03.07.39; Fri, 07 Feb 2020 03:07:51 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=AlQ+VhSS; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726999AbgBGLGc (ORCPT + 99 others); Fri, 7 Feb 2020 06:06:32 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39225 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgBGLGc (ORCPT ); Fri, 7 Feb 2020 06:06:32 -0500 Received: by mail-wm1-f67.google.com with SMTP id c84so2242999wme.4 for ; Fri, 07 Feb 2020 03:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zMsp4UuAC/b8KhB/mSZIHIFY0+hSXiMGCvZikBQPSDs=; b=AlQ+VhSSpa1w8im3H1saI+wH+pPu18xiDfClRNoHpuj/Y+IYkgToiTVl2CtkNoPvFq uDozDztwK1niVDVCk75dNY2f/F1bj3xin2h9ZZv1dD647xqMJSiFHmZ+5r/AkX28ZW+c SrbARE9aW4FefNGo9AgGyrXEkKVmBoKpHI2PJjELIbW1WN2uBL8bmCGHq7/6m0+++Uyq CBMB8JWEpo6uMTCZRQGHsKjRugNdsh7wBuf0monJ4WwEtkmxiIHjDv/8eZAgkCF49OFV e5zZUWl7KPbnNwuw8sz3rKt5ks58cx7ojBYXj7xcA7YZmas7zcgu4+GnTNwYFDaStPkf R+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=zMsp4UuAC/b8KhB/mSZIHIFY0+hSXiMGCvZikBQPSDs=; b=iw/rTGEMqDKaWDD1QaD61fwY4w055pe0l1lCSxkQcqijwrHBXWCSOEmmbOye30+uuO /oggOyczcD9+v2puU0LyWfoYpDWDhxti9qyCiaWTYF+9vet+Z8L9JumqFhsIpPO/WAxK J0V7PRQlnGJ6P6ZjEFsLwBEXKo44AU3QOWqovdj1opzAb0iQH5VvE5bYmSVK6MYD9nSw 4u4GdMejfVJ35vStHDhkk8h5KaZPTEqPrMmn5d5rZ6A7kmRtNOOEARTc3ShdvbZyanuU k79/OoDeSlGNHj13s6bjtGRJWUfkfDys34J/wTaEiIJ32M1KeAJJTYio2i7wnG63tbs+ WRpA== X-Gm-Message-State: APjAAAUNdGBIyQLkK8/rRfavq+RG9J5/5eimrwQvLjBiEk7QJ0K5bqfD 3Dck6YNIx1L6IDBqz9azMOM= X-Received: by 2002:a1c:5441:: with SMTP id p1mr3992501wmi.161.1581073590233; Fri, 07 Feb 2020 03:06:30 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id l15sm2925650wrv.39.2020.02.07.03.06.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Feb 2020 03:06:29 -0800 (PST) Date: Fri, 7 Feb 2020 11:06:29 +0000 From: Wei Yang To: Dan Williams Cc: Wei Yang , Andrew Morton , Oscar Salvador , Linux MM , Linux Kernel Mailing List , Baoquan He , David Hildenbrand Subject: Re: [PATCH 1/3] mm/sparsemem: adjust memmap only for SPARSEMEM_VMEMMAP Message-ID: <20200207110629.qkovh23k7ihzh4a3@master> Reply-To: Wei Yang References: <20200206231629.14151-1-richardw.yang@linux.intel.com> <20200206231629.14151-2-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 06, 2020 at 06:00:13PM -0800, Dan Williams wrote: >On Thu, Feb 6, 2020 at 3:17 PM Wei Yang wrote: >> >> Only when SPARSEMEM_VMEMMAP is set, memmap returned from >> section_activate() points to sub-section page struct. Otherwise, memmap >> already points to the whole section page struct. >> >> This means only for SPARSEMEM_VMEMMAP, we need to adjust memmap for >> sub-section case. >> >> Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") >> Signed-off-by: Wei Yang >> CC: Dan Williams >> --- >> mm/sparse.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/mm/sparse.c b/mm/sparse.c >> index 586d85662978..b5da121bdd6e 100644 >> --- a/mm/sparse.c >> +++ b/mm/sparse.c >> @@ -886,7 +886,8 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, >> section_mark_present(ms); >> >> /* Align memmap to section boundary in the subsection case */ >> - if (section_nr_to_pfn(section_nr) != start_pfn) >> + if (IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP) && >> + section_nr_to_pfn(section_nr) != start_pfn) > >Aren't we assured that start_pfn is always section aligned in the >SPARSEMEM case? That's the role of check_pfn_span(). Does the change >have a runtime impact or is this just theoretical? You are right, I missed this point. Thanks -- Wei Yang Help you, Help me