]> 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)
commit315b7a3e1159fe6e3300cb1711526a6c65d91b3a
tree01d5d6dee0d368893537cda299d05b55b1b8cb15
parentadcd6635796d7ee660b79cc94a3aed7b3e2aec91
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: b4453af3ac5b ("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