From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@suse.com,
david@redhat.com, richardw.yang@linux.intel.com,
dan.j.williams@intel.com, osalvador@suse.de, rppt@linux.ibm.com,
bhe@redhat.com
Subject: [PATCH v3 0/7] mm/hotplug: Only use subsection map for VMEMMAP
Date: Sat, 7 Mar 2020 16:42:22 +0800 [thread overview]
Message-ID: <20200307084229.28251-1-bhe@redhat.com> (raw)
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, config ZONE_DEVICE depends on SPARSEMEM_VMEMMAP. It means
subsection map only makes sense when SPARSEMEM_VMEMMAP enabled. For the
classic sparse, subsection map is meaningless and confusing.
About the classic sparse which doesn't support subsection hotplug, Dan
said it's more because the effort and maintenance burden outweighs the
benefit. Besides, the current 64 bit ARCHes all enable
SPARSEMEM_VMEMMAP_ENABLE by default.
In this patchset, the patches 2~4 ares used to make sub-section map and the
relevant operation only available for VMEMMAP.
Patch 1 fixes a hot remove failure when the classic sparse is enabled.
Patches 5~7 are for document adding and doc/code cleanup.
Changelog
v2->v3:
David spotted a code bug in the old patch 1, the old local variable
subsection_map is invalid once ms->usage is resetting. Add a local
variable 'empty' to cache if subsection_map is empty or not.
Remove the kernel-doc comments for the newly added functions
fill_subsection_map() and clear_subsection_map(). Michal and David
suggested this.
Add a new static function is_subsection_map_empty() to check if the
handled section map is empty, but not return the value from
clear_subsection_map(). David suggested this.
Add document about only VMEMMAP supporting sub-section hotplug, and
check_pfn_span() gating the alignment and size. Michal help rephrase
the words.
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. Suggested 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 note about only VMEMMAP supporting sub-section
support
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 | 159 +++++++++++++++++++++++++++--------------
2 files changed, 107 insertions(+), 54 deletions(-)
--
2.17.2
next reply other threads:[~2020-03-07 8:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-07 8:42 Baoquan He [this message]
2020-03-07 8:42 ` [PATCH v3 1/7] mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case Baoquan He
2020-03-07 20:59 ` Andrew Morton
2020-03-07 22:55 ` Baoquan He
2020-03-09 8:56 ` David Hildenbrand
2020-03-09 8:58 ` David Hildenbrand
2020-03-09 13:18 ` Baoquan He
2020-03-09 13:22 ` David Hildenbrand
2020-03-09 10:13 ` Pankaj Gupta
2020-03-09 12:56 ` Michal Hocko
2020-03-07 8:42 ` [PATCH v3 2/7] mm/sparse.c: introduce new function fill_subsection_map() Baoquan He
2020-03-07 8:42 ` [PATCH v3 3/7] mm/sparse.c: introduce a new function clear_subsection_map() Baoquan He
2020-03-09 8:59 ` David Hildenbrand
2020-03-09 13:32 ` Baoquan He
2020-03-09 13:38 ` David Hildenbrand
2020-03-09 14:07 ` Baoquan He
2020-03-07 8:42 ` [PATCH v3 4/7] mm/sparse.c: only use subsection map in VMEMMAP case Baoquan He
2020-03-09 9:00 ` David Hildenbrand
2020-03-07 8:42 ` [PATCH v3 5/7] mm/sparse.c: add note about only VMEMMAP supporting sub-section support Baoquan He
2020-03-07 11:55 ` Baoquan He
2020-03-10 14:46 ` Michal Hocko
2020-03-11 4:20 ` Baoquan He
2020-03-07 8:42 ` [PATCH v3 6/7] mm/sparse.c: move subsection_map related codes together Baoquan He
2020-03-09 9:08 ` David Hildenbrand
2020-03-09 13:41 ` Baoquan He
2020-03-07 8:42 ` [PATCH v3 7/7] mm/sparse.c: Use __get_free_pages() instead in populate_section_memmap() Baoquan He
2020-03-10 14:56 ` Michal Hocko
2020-03-10 14:59 ` David Hildenbrand
2020-03-11 9:31 ` Baoquan He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200307084229.28251-1-bhe@redhat.com \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=richardw.yang@linux.intel.com \
--cc=rppt@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).