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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 E9DAEC2BA83 for ; Wed, 12 Feb 2020 11:20:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE31B2073C for ; Wed, 12 Feb 2020 11:20:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ITmFV6Ik" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE31B2073C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B9496B0429; Wed, 12 Feb 2020 06:20:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 469076B042A; Wed, 12 Feb 2020 06:20:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37F3A6B042B; Wed, 12 Feb 2020 06:20:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 208976B0429 for ; Wed, 12 Feb 2020 06:20:17 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D503F180AD807 for ; Wed, 12 Feb 2020 11:20:16 +0000 (UTC) X-FDA: 76481231232.06.queen86_3c9079842bd12 X-HE-Tag: queen86_3c9079842bd12 X-Filterd-Recvd-Size: 4583 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Feb 2020 11:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581506415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ISQpWX8qRdL9ZLUrbjv3TLSIeU6toSMj/m/1mOebzDg=; b=ITmFV6Ik8j0F1M62pRKQMD1bY6j0+2gxJEKnbiTP4C4XTklUFJF/5jftt7J+Sc61cpE7oR mxDke+a3Lk2Wkus1e8aYiFh60CY9HUyHvpi5ZQWm4vibTQSqCkBVsIfoU4Ld3BMfD/X4Ff RxBEJdnUQotjEIY1Qcio92xYBCDW+k8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-XcEi_Dj7MAiCndTsDJgohg-1; Wed, 12 Feb 2020 06:20:11 -0500 X-MC-Unique: XcEi_Dj7MAiCndTsDJgohg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4313BDB65; Wed, 12 Feb 2020 11:20:10 +0000 (UTC) Received: from localhost (ovpn-12-47.pek2.redhat.com [10.72.12.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D719E1001B07; Wed, 12 Feb 2020 11:20:03 +0000 (UTC) Date: Wed, 12 Feb 2020 19:20:00 +0800 From: Baoquan He To: Dan Williams , David Hildenbrand Cc: Linux Kernel Mailing List , Linux MM , Andrew Morton , Wei Yang Subject: Re: [PATCH 3/7] mm/sparse.c: only use subsection map in VMEMMAP case Message-ID: <20200212112000.GH8965@MiWiFi-R3L-srv> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable 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 02/12/20 at 10:39am, David Hildenbrand wrote: >=20 >=20 > > Am 11.02.2020 um 21:15 schrieb Dan Williams : > >=20 > > =EF=BB=BFOn Sun, Feb 9, 2020 at 2:48 AM Baoquan He w= rote: > >>=20 > >> Currently, subsection map is used when SPARSEMEM is enabled, includi= ng > >> VMEMMAP case and !VMEMMAP case. However, subsection hotplug is not > >> supported at all in SPARSEMEM|!VMEMMAP case, subsection map is unnec= essary > >> and misleading. Let's adjust code to only allow subsection map being > >> used in SPARSEMEM|VMEMMAP case. > >>=20 > >> Signed-off-by: Baoquan He > >> --- > >> include/linux/mmzone.h | 2 + > >> mm/sparse.c | 231 ++++++++++++++++++++++-----------------= -- > >> 2 files changed, 124 insertions(+), 109 deletions(-) > >>=20 > >> 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) > >>=20 > >> struct mem_section_usage { > >> +#ifdef CONFIG_SPARSEMEM_VMEMMAP > >> DECLARE_BITMAP(subsection_map, SUBSECTIONS_PER_SECTION); > >> +#endif > >=20 > > This was done deliberately so that the SPARSEMEM_VMEMMAP=3Dn case ran= as > > a subset of the SPARSEMEM_VMEMMAP=3Dy case. Thanks for checking this, Dan. Taking away the subsection part, won't affect the classic sparse being a subset of VMEMMAP case, I would say. > >=20 > > The diffstat does not seem to agree that this is any clearer: > >=20 > > 124 insertions(+), 109 deletions(-) > >=20 >=20 > I don=E2=80=98t see a reason to work with subsections (+store them) if = subsections are not supported. >=20 > I do welcome this cleanup. Diffstats don=E2=80=98t tell the whole story= . Thanks for clarifying this, David, I agree. If applying the patch, it should be easier to observe that the code is simpler to follow, at least won't be confusing on subsection handling part.