Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp243717ybv; Wed, 19 Feb 2020 20:34:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxZ5KA6NJ2f5ukMrS8Tem1rr2llgv35ytQU4nSM2Zc2QNKDpoCiRYY8gtRZqviamrk3fC0C X-Received: by 2002:aca:2315:: with SMTP id e21mr744492oie.147.1582173252039; Wed, 19 Feb 2020 20:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582173252; cv=none; d=google.com; s=arc-20160816; b=HhN6S0vkr4UaB4P21T2V3fbz/7I6ilm65TpSK3l4tN6RPNcp47RErsreFWSJBAOzA6 4QvKwub9tTBhMrl0nbsD9kc3UN+NwYPZaOG4BWzkKjmhqFoBxZUNqm2oRTbB1oCq2hhI FwuW39ZUcXO5QKU92w+uGT5E3u7uCCaKThwy1lSAeCnWbcQVsU3EC8INlUYmYjODTsmP d1xLnO+YC5ZsZFsZk3/tkbzsHPZI1oav3WEZlWugfK16SXmWzolbt4z8FzgldeNgIvV7 RKdiFwVurR9ieD5N++2teuy1k9yONT7S9J0o/FZbVYzmy1VhrkYUypFQvtw8XyWcQANa NGag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=7DqC/cWvoNfH4S97tWnGRiY8s53fR26RRmf0ozJgcU8=; b=IUHqvlAVpwm43+XzcCndvGsF4aaJikfF02reYlC+g0OJDP1o1ZTv/5ZQIAUcwJDh1u 2o9cMwZAtoEHDp71cUYUNpuwT2CYf76tKSIcegvEOnPJJiPXit5Qv3tuO97mMPBO4v0o w2LxnazPEmOeMrC3w5fPlZQALd/cWMhKLwVTpMKLPDgbRjZbYrRCxuDbgZq3JFEWthPX 4GLOMpk4wUa/Qcb2f9z5AFe+zioxMF43lD+VFJsJHaf8poWsZO/o4nFRTlsAUo0p7RgE 81TJ0ozTitny/mLUv8uq+BLrJedwJS8cdgXbk2rE4dsChbqbQMDpZH+jF9PnhazUtbEx TdVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BPKXKS9f; 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 h28si1255892otg.63.2020.02.19.20.33.44; Wed, 19 Feb 2020 20:34:12 -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=BPKXKS9f; 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 S1727932AbgBTEdf (ORCPT + 99 others); Wed, 19 Feb 2020 23:33:35 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:53535 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727476AbgBTEde (ORCPT ); Wed, 19 Feb 2020 23:33:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582173213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=7DqC/cWvoNfH4S97tWnGRiY8s53fR26RRmf0ozJgcU8=; b=BPKXKS9fCsPL00vJu7krnhT02LlTn6kSzYrhE160PPv12Fb26Fc8qlrng2FYeBjHvU9FYn +qdOcFb9JyzXAZj8+DefKafPNJFouGnwBe7yJV8ljgfsAVllExQUrIQSvg1gVQEySNOaMc H7dIB+QAHeKLtJI3SJ89RwAboxp2pys= 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-100-nVuufj3uNGak-C0Kp8jEZg-1; Wed, 19 Feb 2020 23:33:28 -0500 X-MC-Unique: nVuufj3uNGak-C0Kp8jEZg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0AEB4800D53; Thu, 20 Feb 2020 04:33:26 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BE725DA60; Thu, 20 Feb 2020 04:33:18 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, mhocko@suse.com, bhe@redhat.com, rppt@linux.ibm.com, robin.murphy@arm.com Subject: [PATCH v2 0/7] mm/hotplug: Only use subsection map in VMEMMAP case Date: Thu, 20 Feb 2020 12:33:09 +0800 Message-Id: <20200220043316.19668-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Hence there's no need to operate subsection map in SPARSEMEM|!VMEMMAP case. In this patchset, change codes to make sub-section map and the relevant operation only available in VMEMMAP case. And since sub-section hotplug added, the hot add/remove functionality have been broken in SPARSEMEM|!VMEMMAP case. Wei Yang and I, each of us make one patch to fix one of the failures. In this patchset, the patch 1/7 from me is used to fix the hot remove failure. Wei Yang's patch has been merged by Andrew. Changelog: v1->v2: Move the hot remove fixing patch to the front so that people can back port it to easier. Suggested by David. Split the old patch which invalidate the sub-section map in !VMEMMAP case into two patches, patch 4/7, and patch 6/7. This makes patch reviewing easier. David by David. Take Wei Yang's fixing patch out to post alone, since it has been reviewed and acked by people. Suggested by Andrew. Fix a code comment mistake in the current patch 2/7. Found out by Wei Yang during reviewing. Baoquan He (7): mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case mm/sparse.c: introduce new function fill_subsection_map() mm/sparse.c: introduce a new function clear_subsection_map() mm/sparse.c: only use subsection map in VMEMMAP case mm/sparse.c: add code comment about sub-section hotplug mm/sparse.c: move subsection_map related codes together mm/sparse.c: Use __get_free_pages() instead in populate_section_memmap() include/linux/mmzone.h | 2 + mm/sparse.c | 178 +++++++++++++++++++++++++++++------------ 2 files changed, 127 insertions(+), 53 deletions(-) -- 2.17.2