Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4414434ybv; Tue, 25 Feb 2020 19:45:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxGuJyQpifaqnttvxx4uB0zf/5aDaUOwflRN/nKDj4NT5hMNTt0MsvaKoTsQ7nQ/0Eirptg X-Received: by 2002:a9d:6181:: with SMTP id g1mr1473909otk.104.1582688731497; Tue, 25 Feb 2020 19:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582688731; cv=none; d=google.com; s=arc-20160816; b=IugXgYDqi7K61OGIBEkmxk0RwXNrjUQHPxFHZDVKdvgvfLgPN/xF244oi+C55LqXxJ AUakyDTmz/UgBisoS/kZ6lk9RiMlhFl2aiXRui+xlGw9X3+7+xCwYChfAWbz8T+7g85v WuKWV3Nh4IW/E4Pqy+nHDTaerVibEo2O/GbIEGZveMRVa0W85sFZeCPigk07+xQxf4/U X/yvZs2Z2yM5uzn/TSd2TaumrfDhlE7GT/itMlhq52ptNhL3wAF3TgTdQ8g6bqtcySPd XzZZwE/zz8uOh+Qg8YHwsX3EaZYvTwBygd8s7FoO+7b7FpV4JlaaCDhU8s1VxFaTNaXI wVog== 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=g4gojvp3vC3N2CngBOtMsPIUT4YDPupheuU+NRdhvhM=; b=wZMN+JgajVpk4J/mMPU/v7l/FjkbLwdUZvJBL6SGWGMDHzmXWzWDEeU7Qv9RKI6ix/ 0ZNX09WR6UwhYloVdLzWc2OaFHOKMglYILS6NPn4bx1XjBfN41lsvt/7m6rPKHyk78dP B8hgU1DAbHhAZRXWbMudYfxmcKVbnVyuGA2BWIX5T4H5+yBG9NAFHJxLIqifoHiM0ac+ vE9/siIEJxW8w7ThpKKzIw458oxTlgHBSSf00kvRZDr4JtN6cDuYE1ufpVFUKiRrRknQ eSqvP0rrh67/ZzolqJM3gImt8J2tN9tN1Nc5cqsk7qoKsXzJj0T3cZgYdOILko40aFGj zrjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JgKIMjah; 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 z23si543374oti.34.2020.02.25.19.45.19; Tue, 25 Feb 2020 19:45:31 -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=JgKIMjah; 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 S1726417AbgBZDop (ORCPT + 99 others); Tue, 25 Feb 2020 22:44:45 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:25794 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726024AbgBZDop (ORCPT ); Tue, 25 Feb 2020 22:44:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582688684; 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=g4gojvp3vC3N2CngBOtMsPIUT4YDPupheuU+NRdhvhM=; b=JgKIMjahHNKVmPvxwU+G8EZgwvxV119uu/8PskdipBPDOzxv0LIBE/ADLN4En1Ol+v9FdA ETLsaufXa+d8CiTXLWCinMMMZr3cl044eV1FWXH9mqoYfR5All6cmrs9DrYQAnzKr8TdAA CjAi0249SCtWYMq9Y/pCN7zSRWz6wiA= 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-143-WJgVg_aSNIeoVPp7BnFFgA-1; Tue, 25 Feb 2020 22:44:42 -0500 X-MC-Unique: WJgVg_aSNIeoVPp7BnFFgA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8117E107ACC5; Wed, 26 Feb 2020 03:44:40 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB16590519; Wed, 26 Feb 2020 03:44:36 +0000 (UTC) Date: Wed, 26 Feb 2020 11:44:33 +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 0/7] mm/hotplug: Only use subsection map in VMEMMAP case Message-ID: <20200226034433.GE24216@MiWiFi-R3L-srv> References: <20200220043316.19668-1-bhe@redhat.com> <20200220103849.GG20509@dhcp22.suse.cz> <20200221142847.GG4937@MiWiFi-R3L-srv> <20200225100352.GN22443@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200225100352.GN22443@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/25/20 at 11:03am, Michal Hocko wrote: > On Fri 21-02-20 22:28:47, Baoquan He wrote: > > On 02/20/20 at 11:38am, Michal Hocko wrote: > > > On Thu 20-02-20 12:33:09, Baoquan He wrote: > > > > Memory sub-section hotplug was added to fix the issue that nvdimm could > > > > be mapped at non-section aligned starting address. A subsection map is > > > > added into struct mem_section_usage to implement it. However, sub-section > > > > is only supported in VMEMMAP case. > > > > > > Why? Is there any fundamental reason or just a lack of implementation? > > > VMEMMAP should be really only an implementation detail unless I am > > > missing something subtle. > > > > Thanks for checking. > > > > VMEMMAP is one of two ways to convert a PFN to the corresponding > > 'struct page' in SPARSE model. I mentioned them as VMEMMAP case, or > > !VMEMMAP case because we called them like this previously when reviewed > > patches, hope it won't cause confusion. > > > > Currently, config ZONE_DEVICE depends on SPARSEMEM_VMEMMAP. The > > subsection_map is added to struct mem_section_usage to track which sub > > section is present, VMEMMAP fills those bits which corresponding > > sub-sections are present, while !VMEMMAP, namely classic SPARSE, fills > > the whole map always. > > > > As we know, VMEMMAP builds page table to map a cluster of 'struct page' > > into the corresponding area of 'vmemmap'. Subsection hotplug can be > > supported naturally, w/o any change, just map needed region related to > > sub-sections on demand. For !VMEMMAP, it allocates memmap with > > alloc_pages() or vmalloc, thing is a little complicated, e.g the mixed > > section, boot memory occupies the starting area, later pmem hot added to > > the rear part. > > > > About !VMEMMAP which doesn't support sub-section hotplog, Dan said > > it's more because the effort and maintenance burden outweighs the > > benefit. And the current 64 bit ARCHes all enable > > SPARSEMEM_VMEMMAP_ENABLE by default. > > OK, if this is the primary argument then make sure to document it in the > changelog (cover letter). Will add it when repost.