]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: vsie/gmap: reduce gmap_rmap overhead
authorChristian Borntraeger <borntraeger@linux.ibm.com>
Fri, 29 Apr 2022 15:15:26 +0000 (17:15 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 3 May 2022 13:15:44 +0000 (15:15 +0200)
commit1c5c0f92d1b04899ad0a433be6220c9ad152de4f
tree01d5d6dee0d368893537cda299d05b55b1b8cb15
parente57b5ade7e33831a98fafc0b25d4b99be50849fb
KVM: s390: vsie/gmap: reduce gmap_rmap overhead

there are cases that trigger a 2nd shadow event for the same
vmaddr/raddr combination. (prefix changes, reboots, some known races)
This will increase memory usages and it will result in long latencies
when cleaning up, e.g. on shutdown. To avoid cases with a list that has
hundreds of identical raddrs we check existing entries at insert time.
As this measurably reduces the list length this will be faster than
traversing the list at shutdown time.

In the long run several places will be optimized to create less entries
and a shrinker might be necessary.

Fixes: fbc59adf6616 ("s390/mm: add shadow gmap support")
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20220429151526.1560-1-borntraeger@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/mm/gmap.c