OSDN Git Service

s390/vmem: consolidate vmem_add_range() and vmem_remove_range()
authorDavid Hildenbrand <david@redhat.com>
Wed, 22 Jul 2020 09:45:51 +0000 (11:45 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 27 Jul 2020 08:33:36 +0000 (10:33 +0200)
commit3e0d3e408e63839625b210e5eb7269c45b870a38
treeab5d3bfb12b239177d035e6aac36f8baf5006d88
parent8398b226b8f01df902450658a139ee01d9f4c482
s390/vmem: consolidate vmem_add_range() and vmem_remove_range()

We want to have only a single pagetable walker and reuse the same
functionality for vmemmap handling. Let's start by consolidating
vmem_add_range() and vmem_remove_range(), converting it into a
recursive implementation.

A recursive implementation makes it easier to expand individual cases
without harming readability. In addition, we minimize traversing the
whole hierarchy over and over again.

One change is that we don't unmap large PMDs/PUDs when not completely
covered by the request, something that should never happen with direct
mappings, unless one would be removing in other granularity than added,
which would be broken already.

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-3-david@redhat.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/mm/vmem.c