diff options
author | Ingo Molnar <mingo@kernel.org> | 2020-01-20 08:05:16 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-01-20 08:05:16 +0100 |
commit | a786810cc864e31237a755b933e8872ba3e118bc (patch) | |
tree | f94bd068691d03be00b582fd2fdabe7ccff0f044 /mm/sparse.c | |
parent | efi: Allow disabling PCI busmastering on bridges during boot (diff) | |
parent | Linux 5.5-rc7 (diff) | |
download | linux-a786810cc864e31237a755b933e8872ba3e118bc.tar.xz linux-a786810cc864e31237a755b933e8872ba3e118bc.zip |
Merge tag 'v5.5-rc7' into efi/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.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; } |