From: Oscar Salvador <osalvador@suse.de>
To: akpm@linux-foundation.org
Cc: dan.j.williams@intel.com, david@redhat.com,
pasha.tatashin@soleen.com, mhocko@suse.com,
aneesh.kumar@linux.ibm.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Oscar Salvador <osalvador@suse.de>
Subject: [PATCH 0/2] Fixes for sub-section hotplug
Date: Mon, 15 Jul 2019 10:15:47 +0200 [thread overview]
Message-ID: <20190715081549.32577-1-osalvador@suse.de> (raw)
Hi all,
these two patches address a couple of issues I found while working on my
vmemmap-patchset.
The issues are:
1) section_deactivate mistakenly zeroes ms->section_mem_map and then
tries to check whether the section is an early section, but since
section_mem_map might have been zeroed, we will return false
when it is really an early section.
In order to fix this, let us check whether the section is early
at function entry, so we do not neet check it again later.
2) shrink_{node,zone}_span work on sub-section granularity now.
The problem is that deactivation of the section occurs later on
in sparse_remove_section, so the pfn_valid()->pfn_section_valid()
check will always return true.
The user visible effect of this is that we are always left with,
at least, PAGES_PER_SECTION spanned, even if we got to remove all
memory linked to a zone.
In order to fix this, decouple section_deactivate() from
sparse_remove_section, and let __remove_section first call
section_deactivate(), so then __remove_zone()->shrink_{zone,node}
will find the right information.
Actually, both patches could be merged in one, but I went this way to make it
more smooth.
Once this have been merged (unless there is a major controvery), I plan to send
out a patch refactoring shrink_{node,zone}_span, since right now it is a bit
messy.
Oscar Salvador (2):
mm,sparse: Fix deactivate_section for early sections
mm,memory_hotplug: Fix shrink_{zone,node}_span
include/linux/memory_hotplug.h | 7 ++--
mm/memory_hotplug.c | 6 +++-
mm/sparse.c | 76 +++++++++++++++++++++++++++++-------------
3 files changed, 62 insertions(+), 27 deletions(-)
--
2.12.3
next reply other threads:[~2019-07-15 8:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 8:15 Oscar Salvador [this message]
2019-07-15 8:15 ` [PATCH 1/2] mm,sparse: Fix deactivate_section for early sections Oscar Salvador
2019-07-15 16:02 ` Aneesh Kumar K.V
2019-07-16 4:33 ` Dan Williams
2019-07-18 12:07 ` David Hildenbrand
2019-07-15 8:15 ` [PATCH 2/2] mm,memory_hotplug: Fix shrink_{zone,node}_span Oscar Salvador
2019-07-15 16:11 ` Aneesh Kumar K.V
2019-07-15 21:24 ` Oscar Salvador
2019-07-17 2:28 ` Dan Williams
2019-07-17 7:38 ` Oscar Salvador
2019-07-17 8:01 ` David Hildenbrand
2019-07-17 8:08 ` Oscar Salvador
2019-07-17 5:38 ` Aneesh Kumar K.V
2019-07-17 7:42 ` Oscar Salvador
2019-07-18 12:05 ` Oscar Salvador
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=20190715081549.32577-1-osalvador@suse.de \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--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=pasha.tatashin@soleen.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).