Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6199981ybv; Wed, 12 Feb 2020 07:48:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyfI/qaCflpm6U3ZniVOL7NzHdJnYSgDfndf5PUam8OjvZHpptUiMtZTjOTtVW3r3hlWx5c X-Received: by 2002:a9d:7548:: with SMTP id b8mr10203007otl.74.1581522535531; Wed, 12 Feb 2020 07:48:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581522535; cv=none; d=google.com; s=arc-20160816; b=seyriuQUzipdXZBCRS3Ph4dmTWaPOewKxuvB2I1lpAHMEDxtR4EenWYda20gRd4kzM 0ZnlpDPK09A38YQqtPhiwVNE8cFwiZ3EAlr4rTma4JdCxLYhGhDqpoluToPB1l/bwWmt UE8imcHGHhAjytm/5XJ/B2KIkZh/BHrvUkQQSOS01eh/5qu2teq/Q2PTGZIegVgJkQVr Utd8x/iYSx8CYmLqPLW9hXGJkMPOwiJpkDN+PRiuvTl6CzqF4iPgqY6vm83Wrus+y56Y 6qMkpkapE3M8Cc6m5Oky6V/gqRRG6UzYUV8EINiAhHBFklJx8juYMBZxGZS4mz5Sr0a4 CPkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RiyUJRYQDifXthKtqUrBbgC+x2gDb+r3PWtg2ESrB1w=; b=EQKOrFVrKvcCHe9YY0fyZRD4ijSCRRyKh8E4ZiSGMNxm5dbwmCYKCHIhjN1taUNZzV zsz+2eA+rDwiWcHE0Rm3GhXlJC0s/u67AizgqCx91s2aEYY1RHkItlQdNCSnvaeH2vW7 iqqTm/NfEX1lVAGCeR3y/xmxBhMzlRqErP503jyUnFoXl5tKXxoizDQUrz6y7ZqDiQ3T QrkFKoHF88rHPsb9ric/9nY05x1mDJ5ikOphA2304R+eg6gHwKmU8L9eNJ4kdOLO9ldd 1R8U6e05KFH/P4nv+v9FMgxjMAq3+jVGDONnsi/PkewOXZ0W3AcpeCy6QIkTN0rc5S2e nwlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=swQL9Vex; 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 s77si3503309oih.51.2020.02.12.07.48.42; Wed, 12 Feb 2020 07:48:55 -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=swQL9Vex; 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 S1728460AbgBLPs1 (ORCPT + 99 others); Wed, 12 Feb 2020 10:48:27 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:33232 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbgBLPs0 (ORCPT ); Wed, 12 Feb 2020 10:48:26 -0500 Received: by mail-ot1-f67.google.com with SMTP id b18so2382025otp.0 for ; Wed, 12 Feb 2020 07:48:26 -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:content-transfer-encoding; bh=RiyUJRYQDifXthKtqUrBbgC+x2gDb+r3PWtg2ESrB1w=; b=swQL9VexYbth8r+D/qtA6NetBD0R3raRgaQ4oy5J6NJ1r+6/nXd5n5NsS5Hy2hWs46 y4a8JArUVroppmcYoL8ypMTww971R/cBRepn1qFuyDanwF3UgtUNDH/xPxyiD2TA/xXB wRVfymO8i5ofcecJopl4yfDjNhh1jEnteA7pIH/r1qB8G6dXghwO0BcuWJiOy4fF++Ra z/6AxPB84iuSvaBsLmx00garTeak/2JsWj4e9edNfqTMdBfC807VGvOfmooocARAPoTy EjYcgY1AAr32Srv+Idh+nYq+30IOExJq8btsQ33OJLnQTDvo3lUyi176CDrs7JgnejIJ olQw== 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:content-transfer-encoding; bh=RiyUJRYQDifXthKtqUrBbgC+x2gDb+r3PWtg2ESrB1w=; b=K4vRqVxo2dllH5NO1MtVpqL/E9mOdF/lYRbkoG1ffHv33IjDZXma9HjJ7i07je5fgX lqayFxWcmDDfi9NkGZ1S0LCkkt4jWnzNuUBTRI81A3m5ogdjC94bDXY7aVSyJT4C72nq my9WilMPNnhsEVvQY/WdDtt4o1FjCBvweRBohIGaD1oH5R/Hyl4cIDWd5H2rRd6hKtuA 6y5kiOJWdK2/TRQUKbX3j4ytVlNJvhISSihoM+mJbFmnDWN2DMV+X22yiUK5ZldPHPyA 7Au+FZtVL1MygV6PVqVGFIL+6B5NJlcTbpmLktVBWp1a8YUG4FhVcr5EzfB1ASt251ty oJEw== X-Gm-Message-State: APjAAAVcqTJE/SuP0rf01dmaCTFUYwUZ1xQNxXhQoRfItl+HRyg8t0/S 1w1zHMowYfyNgIm+QTH/lRLCMXKae0OXY+DlUO+DcQ== X-Received: by 2002:a9d:4e99:: with SMTP id v25mr10094670otk.363.1581522506203; Wed, 12 Feb 2020 07:48:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dan Williams Date: Wed, 12 Feb 2020 07:48:15 -0800 Message-ID: Subject: Re: [PATCH 3/7] mm/sparse.c: only use subsection map in VMEMMAP case To: David Hildenbrand Cc: Baoquan He , Linux Kernel Mailing List , Linux MM , Andrew Morton , Wei Yang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 12, 2020 at 1:40 AM David Hildenbrand wrote: > > > > > Am 11.02.2020 um 21:15 schrieb Dan Williams : > > > > =EF=BB=BFOn Sun, Feb 9, 2020 at 2:48 AM Baoquan He wro= te: > >> > >> 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 unneces= sary > >> 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(un= signed 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=3Dn case ran a= s > > a subset of the SPARSEMEM_VMEMMAP=3Dy case. > > > > The diffstat does not seem to agree that this is any clearer: > > > > 124 insertions(+), 109 deletions(-) > > > > I don=E2=80=98t see a reason to work with subsections (+store them) if su= bsections are not supported. > > I do welcome this cleanup. Diffstats don=E2=80=98t tell the whole story. I'll take a look at the final result and see if my opinion changes, but I just wanted to clarify upfront that making sparsemem run some of the subsection logic was deliberate.