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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 E8B7DC4BA0A for ; Wed, 26 Feb 2020 03:53:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A70121927 for ; Wed, 26 Feb 2020 03:53:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aB6CJYWv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A70121927 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 0384C6B0003; Tue, 25 Feb 2020 22:53:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F29756B0005; Tue, 25 Feb 2020 22:53:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3F036B0006; Tue, 25 Feb 2020 22:53:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id C885E6B0003 for ; Tue, 25 Feb 2020 22:53:49 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6315A181AC9B6 for ; Wed, 26 Feb 2020 03:53:49 +0000 (UTC) X-FDA: 76530909378.16.alarm25_21553f89d5a0c X-HE-Tag: alarm25_21553f89d5a0c X-Filterd-Recvd-Size: 3490 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Feb 2020 03:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582689228; 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: in-reply-to:in-reply-to:references:references; bh=jPawdqnS4wqhOXPwRMpMZXtAzJ3OHZG8p6E7J26KlZ8=; b=aB6CJYWvr+5zDahbGBXsuld47MifqtKcFymaX6I4He6rm9e53C/R8MyYEjIE+fVTAOMXuY lLPF2PJnPpOHppfcijpMOGJk4WZBfVgGozYykbsRTWAKUkg4diQdU2DXwEjPAWQIgyAQRR /Zu1IXtMlfbMYde9Q+mnRvwZMVid7H8= 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-388-qbuKqQ2GNoKbWmazEt9ICw-1; Tue, 25 Feb 2020 22:53:44 -0500 X-MC-Unique: qbuKqQ2GNoKbWmazEt9ICw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E50C58017CC; Wed, 26 Feb 2020 03:53:42 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9ECBF92966; Wed, 26 Feb 2020 03:53:39 +0000 (UTC) Date: Wed, 26 Feb 2020 11:53:36 +0800 From: Baoquan He To: Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, rppt@linux.ibm.com, robin.murphy@arm.com Subject: Re: [PATCH v2 4/7] mm/sparse.c: only use subsection map in VMEMMAP case Message-ID: <20200226035336.GF24216@MiWiFi-R3L-srv> References: <20200220043316.19668-1-bhe@redhat.com> <20200220043316.19668-5-bhe@redhat.com> <20200225095713.GL22443@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200225095713.GL22443@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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/25/20 at 10:57am, Michal Hocko wrote: > On Thu 20-02-20 12:33:13, 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 VMEMMAP case. > > This really needs more explanation I believe. What exactly happens if > somebody tries to hotremove a part of the section with !VMEMMAP? I can > see that clear_subsection_map returns 0 but that is not an error code. > Besides that section_deactivate doesn't propagate the error upwards. > /me stares into the code > > OK, I can see it now. It is relying on check_pfn_span to use the proper > subsection granularity. This really begs for a comment in the code > somewhere. Yes, check_pfn_span() guards it. People have no way to hot add/remove on non-section aligned block with !VMEMMAP. I have added extra comment to above section_activate() to note this, please check patch 5/7. Let me see how to add words to reflect the check_pfn_span() guard thing.