Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5333046ybv; Tue, 11 Feb 2020 13:42:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxnafI1cbThRpPoViBXO8bw14+/eNGO2xNuHU2QY3pf6JXYbpVjPPi+H1qKheyHkSJmo+Rg X-Received: by 2002:a05:6830:43:: with SMTP id d3mr7143493otp.259.1581457349535; Tue, 11 Feb 2020 13:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457349; cv=none; d=google.com; s=arc-20160816; b=xEdExg3nF6Md57dxQQKOpDo4PDDsu12QAKwB9uXiFYsxZoYbA1nscyhMCDBAL/056M aOsgKzlJGvadaAJjulunh94c9XskbfbK/jS5sJX97N/FyINDtM8R+rD6bZZXQQkq9BZ+ 52tQrU5O6ce1Gt+O95dQ30JAT2Jierl8UGMca227mO4fdnelcTDooGknuolRcAlMb77g n1fIVWK62R83EFyx521P3/oG65d8YcgSjpX1JpRiFDgIsXTt3WHqn/AXBGbfqISy9qQ+ Vf604ChKfP4GikNorMVNC4Nj2Tb5AouxFZHCAfZxSE4U+eDY2VibMpWBdyjs98YeifO6 Yfzw== 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=2r5sdmKSui2jkFEssHxa47Vgdv1m3DYrrp63QiGVUWU=; b=sH5oY0tF6uz05rFt9/4viyA2dPWm5AG+r1CoO+V8HUDwsH7oSFdSKCHY1x6j5WtaQ2 4XMHzlhgewDLbDXBXyR0NrCSSTWjxbzfPtoM1ghSLuLEfsjWFNQLU1UAsukfHPL2mH6O lOKsfs9ogaoJUipZinZIK0zwKxYEifVt6lWi7NOaZ9o44kt29yZCiWQHI6LWajLvVcDV u9s2W71CaYursMybdC3Hg2FoQJkka28Fb36cFyP4wJ7FJEd3JcRWcpiMi56O3AtRGVym MUiNRnfpdn4V0isxgrHfCOzm/yzYFRM0p9/kn2LRqojtlTKwAXVeZKVIwkOjGe8mr2/W 1+hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=SyhzjwkH; 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 l26si2407375oti.152.2020.02.11.13.42.17; Tue, 11 Feb 2020 13:42:29 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=SyhzjwkH; 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 S1731783AbgBKUPG (ORCPT + 99 others); Tue, 11 Feb 2020 15:15:06 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:42464 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728946AbgBKUPG (ORCPT ); Tue, 11 Feb 2020 15:15:06 -0500 Received: by mail-ot1-f68.google.com with SMTP id 66so11446479otd.9 for ; Tue, 11 Feb 2020 12:15:05 -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=2r5sdmKSui2jkFEssHxa47Vgdv1m3DYrrp63QiGVUWU=; b=SyhzjwkHErCbUOCJB9v+V0MEyf0YZslhfgemR1Wa7kQ/cQl+D3o+iJmTJ74y0V6b3B DhL5v0UbHmtsVa71tU1V2ntxYCvkzXwbCgEnYcdO/V4WP9QeBWumIlpFYYnInEBkejt4 QJEzkMGfatMxdKGl8BJWsQVq7Fxn0M2WOUHjuPIAavC0fBiiLTPf8CYG08yiL8LOh1b5 KlV7fV9/+AN1CccpIcHfSBk3gC0658VEQuQ757ZKtWsEJqgbuIi222Pid0cZoGRWaebY cKT6uVEDXfH654iGowix3kTK5hcaNdZ0Zkwt9ZG9uY6oOgoR4UGNF5dWnqv2g50eKnhm Lj7A== 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=2r5sdmKSui2jkFEssHxa47Vgdv1m3DYrrp63QiGVUWU=; b=Pes37ikf1Zg9psQ1Mtqlxy1/t0P8g73ylmxtGImKENlnXuofEuqDU70aPjH5Iv2yfz grMrM/HbuJcyGGOyDwRrJ0Tn7mupm5gVQMEdwn/BBQcOFv2cD2Y5gmLlK3YtpNwpipSW ZyAIp9ZSWmv7UITmSz7fr7rX8WTgc+5b4PylFP7i4QWu8GZSi4rdMaKePjb5gAa6odwA bBbgfBAztm0QphYRFyK63BOl3Y4kDwucirUjHgRAgjffQMvqkxGCYbkdFQynFwNfg3Pz oPP2/FPtU/z+4PKBH5FjRqQOX6ejXRJtD+T2+u2roxzVxqnHtXL+2/INPtV1f1llhYjJ yoNQ== X-Gm-Message-State: APjAAAXJ55nGJflO2zr9hr7uozr0WpfeWfwPhDQtz1KAt2zUOW/SyjJd XxtbWGOT0iixReXhH3Gy4yUt0gltprskLodBBrXpkw== X-Received: by 2002:a9d:6f11:: with SMTP id n17mr6540670otq.126.1581452105359; Tue, 11 Feb 2020 12:15:05 -0800 (PST) MIME-Version: 1.0 References: <20200209104826.3385-1-bhe@redhat.com> <20200209104826.3385-4-bhe@redhat.com> In-Reply-To: <20200209104826.3385-4-bhe@redhat.com> From: Dan Williams Date: Tue, 11 Feb 2020 12:14:54 -0800 Message-ID: Subject: Re: [PATCH 3/7] mm/sparse.c: only use subsection map in VMEMMAP case To: Baoquan He Cc: Linux Kernel Mailing List , Linux MM , Andrew Morton , Wei Yang , David Hildenbrand 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 Sun, Feb 9, 2020 at 2:48 AM Baoquan He wrote: > > Currently, subsection map is used when SPARSEMEM is enabled, including > VMEMMAP case and !VMEMMAP case. However, subsection hotplug is not > supported at all in SPARSEMEM|!VMEMMAP case, subsection map is unnecessary > and misleading. Let's adjust code to only allow subsection map being > used in SPARSEMEM|VMEMMAP case. > > Signed-off-by: Baoquan He > --- > include/linux/mmzone.h | 2 + > mm/sparse.c | 231 ++++++++++++++++++++++------------------- > 2 files changed, 124 insertions(+), 109 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 462f6873905a..fc0de3a9a51e 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -1185,7 +1185,9 @@ static inline unsigned long section_nr_to_pfn(unsigned long sec) > #define SUBSECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SUBSECTION_MASK) > > struct mem_section_usage { > +#ifdef CONFIG_SPARSEMEM_VMEMMAP > DECLARE_BITMAP(subsection_map, SUBSECTIONS_PER_SECTION); > +#endif This was done deliberately so that the SPARSEMEM_VMEMMAP=n case ran as a subset of the SPARSEMEM_VMEMMAP=y case. The diffstat does not seem to agree that this is any clearer: 124 insertions(+), 109 deletions(-)