diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 09:08:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 09:08:01 +0100 |
commit | fd2d11cc8af46f50a71b16590275d5bad550c504 (patch) | |
tree | 42b171e066c83a19826a6dab3de3c9421db513d3 /mm/sparse.c | |
parent | c20c76acf6ec1df0af3bdd3370f7e3fef4494ba8 (diff) | |
parent | def9d2780727cec3313ed3522d0123158d87224d (diff) |
Merge 5.5-rc7 into char-misc-next
We need the char-misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/sparse.c')
-rw-r--r-- | mm/sparse.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index b20ab7cdac86..3822ecbd8a1f 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -777,7 +777,14 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages, if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) { unsigned long section_nr = pfn_to_section_nr(pfn); - if (!section_is_early) { + /* + * When removing an early section, the usage map is kept (as the + * usage maps of other sections fall into the same page). It + * will be re-used when re-adding the section - which is then no + * longer an early section. If the usage map is PageReserved, it + * was allocated during boot. + */ + if (!PageReserved(virt_to_page(ms->usage))) { kfree(ms->usage); ms->usage = NULL; } |