Jan Glauber 9f2567f6cd lockref: Limit number of cmpxchg loop retries
The lockref cmpxchg loop is unbound as long as the spinlock is not
taken. Depending on the hardware implementation of compare-and-swap
a high number of loop retries might happen.

Add an upper bound to the loop to force the fallback to spinlocks
after some time. A retry value of 100 should not impact any hardware
that does not have this issue.

With the retry limit the performance of an open-close testcase
improved between 60-70% on ThunderX2.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jan Glauber <jglauber@marvell.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-29 03:49:08 +05:30
..
2017-08-15 09:02:08 -07:00
2017-06-09 11:52:07 +02:00
2019-04-20 09:15:07 +02:00
2019-12-05 15:37:53 +01:00
2017-02-24 17:46:57 -08:00
2019-05-21 18:50:21 +02:00
2018-12-08 13:03:35 +01:00
2021-03-06 22:40:17 +05:30
2018-12-13 09:18:52 +01:00
2017-08-15 09:02:07 -07:00