(description was updated)
Several issues with abort handling on lock busy for stack locks:
If we use xabort on lock busy for stack locks, then we jump to inflated locking
before any xbegin call.
However, when +RTMXendForLockBusy is used, we're starting transaction
in stack locking code, detects that lock is inflated, interrupt transaction with
xend call and then jumps to inflated locking.
We should jump to inflated locking without starting a new transaction
regardless to RTMXendForLockBusy value.
Also, in case of xend for lock busy, when we jump to inflated locking on
lock busy, we start counting retries from RTMRetryCount, but IMO we should
start from (RTMRetryCount-1): first attempt was done in stack locking code.
If we jump to inflated locking immediately, then this issue will be resolved.
ILW (M = we do one extra transaction when it is not needed, M = issue could be reproduced with non-default values of options, H = there is no workaround if we want to use RTM locking for stack locks and xend for lock busy) => P3.
See comments for example.