]> git.baikalelectronics.ru Git - kernel.git/commit
s390/gmap: improve THP splitting
authorGerald Schaefer <gerald.schaefer@linux.ibm.com>
Wed, 29 Jul 2020 20:22:34 +0000 (22:22 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Aug 2020 16:16:13 +0000 (18:16 +0200)
commitd2132863ee7f7491c8038a4d3b0895335b9ce13e
tree90e90da496783eecb3ae5ae33d65773d174bd5dd
parent6200eae79820e13fb6fa783f6bb60bf208ef2547
s390/gmap: improve THP splitting

During s390_enable_sie(), we need to take care of splitting all qemu user
process THP mappings. This is currently done with follow_page(FOLL_SPLIT),
by simply iterating over all vma ranges, with PAGE_SIZE increment.

This logic is sub-optimal and can result in a lot of unnecessary overhead,
especially when using qemu and ASAN with large shadow map. Ilya reported
significant system slow-down with one CPU busy for a long time and overall
unresponsiveness.

Fix this by using walk_page_vma() and directly calling split_huge_pmd()
only for present pmds, which greatly reduces overhead.

Cc: <stable@vger.kernel.org> # v5.4+
Reported-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/mm/gmap.c