From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A144C352A5 for ; Fri, 7 Feb 2020 02:00:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0C2F420715 for ; Fri, 7 Feb 2020 02:00:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="mFqfTxH1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C2F420715 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 924056B0003; Thu, 6 Feb 2020 21:00:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8ADD56B0005; Thu, 6 Feb 2020 21:00:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 775036B0007; Thu, 6 Feb 2020 21:00:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id 5B3AA6B0003 for ; Thu, 6 Feb 2020 21:00:26 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 084F0249E for ; Fri, 7 Feb 2020 02:00:26 +0000 (UTC) X-FDA: 76461676452.30.sail58_78264b6bcaa52 X-HE-Tag: sail58_78264b6bcaa52 X-Filterd-Recvd-Size: 4179 Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Feb 2020 02:00:25 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id q81so554435oig.0 for ; Thu, 06 Feb 2020 18:00:25 -0800 (PST) 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=B3CzpWEhjGrNTft9efyOK3iDvmIkcWco/Hi4kp5Xn6c=; b=mFqfTxH17DKWGmlyN+WKWh3LGx9K2vV7Uu6I6markT+umMWzauzf+aSs/chFlQuWyL WjOWy3sp4tBmrfTD+lYBZD4Ptv4uVSLZ8jk7cvuJWPhifk6ocGYh6BDyQmcoQsJwoETy sJsgG04MmnecAng2izL09mlcdFaRFyDcNZFML0VALpeCMK/Yn9cqpJuDjeVLOTShIiIw dHHgAlAaOgJRqgPUWjT4UoBlrZJ1CQIz6i+Y7n8Y1neWZsVe2ZwVbrmkyIrFGiPL6zbA CBmgoVEV6ohxtoeuxJzbcQk6AmoqWEIY26fmJr5y07j79rcYKQz5zkPrXY066zYXynlN s2uw== 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=B3CzpWEhjGrNTft9efyOK3iDvmIkcWco/Hi4kp5Xn6c=; b=n4pMeAexj64HR5WsdF6DGhgGIV45iDQDMTM+LQevEro/R3pJ4WhdrsfCwLVE3jtP+p Entz2JM482DYwt0MoeczjcsPFs3ZqPOjX+I5m55kdqoUk8hmjue7P04gusVse5d6W8Yp icueAfKXxxexoKPZX9n4THh6v5musWgmYKtmLjq+OSxKSDUodtWfdEZtEiyqqhI5fQWR vNEfgQ6/nTGiXF/5lQQHUNRIOOxVPUHeruLq0sD6zNPJDiy6Q+n7O/MT5rL4YcJIUctt moSfJozPCA0Fa34QYLgg0v4onGivhFwMX6qFeDObkew+1l5OVc4ojVMGJDR4NSXCLVRZ CvoA== X-Gm-Message-State: APjAAAWyIaZYrGzwlwBk7sZ2de0tz/TJbmuW3KKX18qvds6367XF6Aus 0DY2N8UQidQ+imU8OsRW+Q6JFk5rlUpw8/OuSDfJhA== X-Google-Smtp-Source: APXvYqzDAxly+x9xhSwzVeIqYYmAXLncXK+51lPngBmnh8tEaAPHsBxMPHY2clTJyT6lZmY1MH3Y9rUK9ynOq3OURAA= X-Received: by 2002:aca:3f54:: with SMTP id m81mr517359oia.73.1581040824822; Thu, 06 Feb 2020 18:00:24 -0800 (PST) MIME-Version: 1.0 References: <20200206231629.14151-1-richardw.yang@linux.intel.com> <20200206231629.14151-2-richardw.yang@linux.intel.com> In-Reply-To: <20200206231629.14151-2-richardw.yang@linux.intel.com> From: Dan Williams Date: Thu, 6 Feb 2020 18:00:13 -0800 Message-ID: Subject: Re: [PATCH 1/3] mm/sparsemem: adjust memmap only for SPARSEMEM_VMEMMAP To: Wei Yang Cc: Andrew Morton , Oscar Salvador , Linux MM , Linux Kernel Mailing List , Baoquan He , David Hildenbrand Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?