s390/spinlock: avoid diagnose loop
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 12 Nov 2015 11:51:17 +0000 (12:51 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 27 Nov 2015 08:24:15 +0000 (09:24 +0100)
commitdb1c45154a82195ad0b4d45d0e330ebac6883b70
tree4d7d411fcda98f9f0e4299c4578f64147696f35d
parent1a2c5840acf9f657c9b580d4ee12a4c9db3429cb
s390/spinlock: avoid diagnose loop

The spinlock implementation calls the diagnose 0x9c / 0x44 immediately
if the SIGP sense running reported the target CPU as not running.

The diagnose 0x9c is a hint to the hypervisor to schedule the target
CPU in preference to the source CPU that issued the diagnose. It can
happen that on return from the diagnose the target CPU has not been
scheduled yet, e.g. if the target logical CPU is on another physical
CPU and the hypervisor did not want to migrate the logical CPU.

Avoid the immediate repeat of the diagnose instruction, instead do
the retry loop before the next invocation of diagnose 0x9c.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/lib/spinlock.c