s390/uaccess: limit number of retries for cmpxchg_user_key()
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Thu, 17 Nov 2022 10:07:45 +0000 (11:07 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 22 Nov 2022 18:38:09 +0000 (19:38 +0100)
commit739ad2e4e15b585a0eaf98b7bdee62b2dd9588c9
tree47e3bf007b081b621e14f43bb887d085877ae05b
parent51098f0eb22e2f54055d75dd25bc84eff07d6d8a
s390/uaccess: limit number of retries for cmpxchg_user_key()

cmpxchg_user_key() for byte and short values is implemented via a one word
cmpxchg loop. Give up trying to perform the cmpxchg if it fails too often
because of contention on the cache line. This ensures that the thread
cannot become stuck in the kernel.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Link: https://lore.kernel.org/r/20221117100745.3253896-1-scgl@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/uaccess.h