Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp381023ybf; Thu, 27 Feb 2020 23:27:45 -0800 (PST) X-Google-Smtp-Source: APXvYqznP3Q58wL6RtDNAkd85i8bLWUbJLCvrmQ5P1Z8Z4uZc+sLM+FbrcBvf+5OHO9MHmECFW+c X-Received: by 2002:aca:b183:: with SMTP id a125mr2179805oif.83.1582874865749; Thu, 27 Feb 2020 23:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582874865; cv=none; d=google.com; s=arc-20160816; b=XyjQrxjNLrGILu3uW5hEQjI1XEdq4n8Bm/tNHruFc2MTX8Vi04qFBo3vWMwDSAQfyM gZBKI+hcTI/h0/d2RF312Kg4JzO8yXLzVy/Ok6Rnud4CPM4N+AIq7ceOP843O05rZSMw 2s8gNepD8+pHPcxkuTqwoCeh/JHwn8Yy+dQKf0Qxiui8QFqg6X4L0e6DGBi2iZ0vVQvB DaOXu55IEg2WSzk508AHpJZPbZoc0gJa2DCcvzzgwsEt06w5kELEi0YVpGnsemvNToL2 03IMfEy5uLOd/U5Zk3yJl+I98EAf92ynjt9gUFP5pejkbclDwxFkObXFRnTGPxjidWeV nVWA== 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=L7BFf3uXb9yK21S3TPwX2wSiIBjZOegUpzP0VwI7fIQ=; b=aV8KgPQz04vw8I2iodiJhwxms3+TnhdDbHAWu+eHdzWk19JtzZVBtII9LT5h2GEGl8 tWReCxCM+284lVSpQwV1PB99+jg/1IFRtMJcCObr2Uvk/iaT9lIlCvLwll13RxeWVi4t nEeteQKgfTDFYWkM3SHinMgcsZxL3Wbw9v6L2btaCTxQBRw35j2ePNGyCPIvRW1zK1tu 8o/bj2tSQkXHccUMMzur4v3Fr+BRFHbOcH73ioEpY3LmbHyYEuxXj6Na6P3V38njs+aP hVgU4N9G3dabSKgMtuX3iL8ABYAvZDk/cZxk0GheebpC4lKJlXi9yIJnQCZW/J/Fffej dTiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hHzS3MsW; 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 n9si1056617ota.103.2020.02.27.23.27.32; Thu, 27 Feb 2020 23:27:45 -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=hHzS3MsW; 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 S1727004AbgB1HZu (ORCPT + 99 others); Fri, 28 Feb 2020 02:25:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50012 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725870AbgB1HZt (ORCPT ); Fri, 28 Feb 2020 02:25:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582874748; 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=L7BFf3uXb9yK21S3TPwX2wSiIBjZOegUpzP0VwI7fIQ=; b=hHzS3MsWXfrfzOfidafS7B3dmDhObfDEUyxH2cypiTvchm5JQ/ojUDRbhxUmkrdWIgIluN u8L9XAzATNB8+O5qYmGB2mMbbjtB3FvIu5zFKn6mwVZ73r+hDMgSmkiQCef+CRmkCMhXuo 4xEUi2i/CVem9/dzInddYoXju0NqNm8= 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-255-aphFgGJoN6eyZv56xMe1Tw-1; Fri, 28 Feb 2020 02:25:44 -0500 X-MC-Unique: aphFgGJoN6eyZv56xMe1Tw-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 A6FC1100550E; Fri, 28 Feb 2020 07:25:42 +0000 (UTC) Received: from localhost (ovpn-12-49.pek2.redhat.com [10.72.12.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 538381001DC2; Fri, 28 Feb 2020 07:25:39 +0000 (UTC) Date: Fri, 28 Feb 2020 15:25: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: <20200228072536.GK24216@MiWiFi-R3L-srv> References: <20200220043316.19668-1-bhe@redhat.com> <20200220043316.19668-5-bhe@redhat.com> <20200225095713.GL22443@dhcp22.suse.cz> <20200226035336.GF24216@MiWiFi-R3L-srv> <20200226091018.GD3771@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226091018.GD3771@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/26/20 at 10:10am, Michal Hocko wrote: > On Wed 26-02-20 11:53:36, Baoquan He wrote: > > 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. > > An explicit note about check_pfn_span gating the proper alignement and > sizing sounds sufficient to me. It's fine to me, I will adjust the description.