s390/vmemmap: remember unused sub-pmd ranges
authorDavid Hildenbrand <david@redhat.com>
Wed, 22 Jul 2020 09:45:57 +0000 (11:45 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 27 Jul 2020 08:34:08 +0000 (10:34 +0200)
commitcd5781d63eaf6dbf89532d8c7c214786b767ee16
tree7d4c1a081345616208b47c5d77d3b68ff0074d2b
parentf2057b4266a6be469ea0630971cf3cd933e42cce
s390/vmemmap: remember unused sub-pmd ranges

With a memmap size of 56 bytes or 72 bytes per page, the memmap for a
256 MB section won't span full PMDs. As we populate single sections and
depopulate single sections, the depopulation step would not be able to
free all vmemmap pmds anymore.

Do it similarly to x86, marking the unused memmap ranges in a special way
(pad it with 0xFD).

This allows us to add/remove sections, cleaning up all allocated
vmemmap pages even if the memmap size is not multiple of 16 bytes per page.

A 56 byte memmap can, for example, be created with !CONFIG_MEMCG and
!CONFIG_SLUB.

Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200722094558.9828-9-david@redhat.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/mm/vmem.c