s390/vmemmap: fallback to PTEs if mapping large PMD fails

Let's fallback to single pages if short on huge pages. No need to stop
memory hotplug.

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-8-david@redhat.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
David Hildenbrand 2020-07-22 11:45:56 +02:00 committed by Heiko Carstens
parent b9ff81003c
commit f2057b4266
1 changed files with 4 additions and 4 deletions

View File

@ -180,11 +180,11 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr,
*/ */
new_page = vmemmap_alloc_block(PMD_SIZE, new_page = vmemmap_alloc_block(PMD_SIZE,
NUMA_NO_NODE); NUMA_NO_NODE);
if (!new_page) if (new_page) {
goto out;
pmd_val(*pmd) = __pa(new_page) | prot; pmd_val(*pmd) = __pa(new_page) | prot;
continue; continue;
} }
}
pte = vmem_pte_alloc(); pte = vmem_pte_alloc();
if (!pte) if (!pte)
goto out; goto out;