Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4421569ybv; Tue, 25 Feb 2020 19:55:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxAYQZMeJGD/4Xne6STHb+CosHptyOvCE1CQJ0QE7ObnAmARR+pGf3IA1ydBLje4GheVj9L X-Received: by 2002:a9d:7356:: with SMTP id l22mr1394355otk.335.1582689317261; Tue, 25 Feb 2020 19:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582689317; cv=none; d=google.com; s=arc-20160816; b=vJmEpli1NQ2vM8lVOwtHXSVcrtG9mIrlk43ua9dpus4MU146iR8lwEq6ETs/Sm+kcv TlCKqdE2rZyutq2iNrUZARjyrLV0AhFTDxjYN3nVuzDijmPJkFNUmT19EtaFzZSw6p7f zTAzf2hjYnwbP74Wt9qyuP4kWFRvEBEHfZrAAouMMY8Biq2Zvr8Q/tv3uApr+8ctEyo1 j8Tq5rFy8HralkZPOF0u0WgLAUrt4oD2nLX+JP+pN63YOL+s1r9Xp7jcdC/F/0pfKMZR rYsRquOoZ6PeCFFb7sYqjW/lHF5Ewjtv6Xozmt3Mot5a/qNbw/LoZB4iFuEVA/b79vCX gZ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jPawdqnS4wqhOXPwRMpMZXtAzJ3OHZG8p6E7J26KlZ8=; b=FvDF+ITJ3hSK3LhgD141oIgfdMB177TgFV9dUia1XXFLNf3kYMqg2ajl9bg8PgOzx7 Hkm6d2YiSQ14YGeHlt8mmBPaFXCHNtJXHoXDukycG5PUfNNx/PHXY0+aebk/ye2FbOsi 1tUpyHx2pw6hMcJAiPWm49D106J737IseBey7sTh5ugiOVp3/8YsogYbCFZPNXzez989 Ea3f0FmLRLyIhCWU8g4JieDhoxvlLBQjtWRvb1RbMPukCkK2sKd9Rqv/C4xlpEgCR5r/ 5g6NjfU6a6l5eq1HrtbHOGv9eXE8lmsPtPHUTETX3Y8TUpbqCOjdkbC+fCewAOlA0zQE +mAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aB6CJYWv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si536777otq.237.2020.02.25.19.55.04; Tue, 25 Feb 2020 19:55:17 -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=@redhat.com header.s=mimecast20190719 header.b=aB6CJYWv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726619AbgBZDxt (ORCPT + 99 others); Tue, 25 Feb 2020 22:53:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47120 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726046AbgBZDxt (ORCPT ); Tue, 25 Feb 2020 22:53:49 -0500 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.