From patchwork Thu Feb 20 04:33:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11393281 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 756A213A4 for ; Thu, 20 Feb 2020 04:33:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D9032465D for ; Thu, 20 Feb 2020 04:33:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Eu9pXtNK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D9032465D 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 658366B0005; Wed, 19 Feb 2020 23:33:33 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6099A6B0006; Wed, 19 Feb 2020 23:33:33 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51D6D6B0007; Wed, 19 Feb 2020 23:33:33 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 3AA706B0005 for ; Wed, 19 Feb 2020 23:33:33 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 17825441E for ; Thu, 20 Feb 2020 04:33:33 +0000 (UTC) X-FDA: 76509236706.14.wrist27_1eeafd163471e X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,:linux-kernel@vger.kernel.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,RULES_HIT:30003:30012:30054:30070,0,RBL:205.139.110.120:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: wrist27_1eeafd163471e X-Filterd-Recvd-Size: 3837 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 04:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582173211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=7DqC/cWvoNfH4S97tWnGRiY8s53fR26RRmf0ozJgcU8=; b=Eu9pXtNK0nd2BaJgTmOtGo3NaUovja0UQh07mj8urmBdnlgN7nhr83D/vlm+XXWZ8pITQ+ H0C5HMhb4TTamKzP2gGAaaaopmNCsg/S7YsJr+sV1CNA+VT81tOSZ1vkuNyDltEhthi1WK VPvzIEJbqwiFKqbj0e1PEl+lQlk2vjM= 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 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: 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(-)