diff options
author | Oscar Salvador <[email protected]> | 2021-04-29 22:57:19 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-04-30 11:20:38 -0700 |
commit | 8d400913c231bd1da74067255816453f96cd35b0 (patch) | |
tree | ffcb43e0fbbd623a042b06aa0fd07a9842343121 /kernel/gcov/base.c | |
parent | 69ccfe74e16bcb61e4817f78ead31b973c36339c (diff) |
x86/vmemmap: handle unpopulated sub-pmd ranges
When sizeof(struct page) is not a power of 2, sections do not span a PMD
anymore and so when populating them some parts of the PMD will remain
unused.
Because of this, PMDs will be left behind when depopulating sections since
remove_pmd_table() thinks that those unused parts are still in use.
Fix this by marking the unused parts with PAGE_UNUSED, so memchr_inv()
will do the right thing and will let us free the PMD when the last user of
it is gone.
This patch is based on a similar patch by David Hildenbrand:
https://lore.kernel.org/linux-mm/[email protected]/
[[email protected]: go back to the ifdef version]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Oscar Salvador <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Acked-by: Dave Hansen <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: "H . Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'kernel/gcov/base.c')
0 files changed, 0 insertions, 0 deletions