• Martin Schwidefsky's avatar
    s390/spinlock: avoid diagnose loop · db1c4515
    Martin Schwidefsky authored
    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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    db1c4515
spinlock.c 6.19 KB