• P
    locking/mutex: Restructure wait loop · 5bbd7e64
    Peter Zijlstra 提交于
    Doesn't really matter yet, but pull the HANDOFF and trylock out from
    under the wait_lock.
    
    The intention is to add an optimistic spin loop here, which requires
    we do not hold the wait_lock, so shuffle code around in preparation.
    
    Also clarify the purpose of taking the wait_lock in the wait loop, its
    tempting to want to avoid it altogether, but the cancellation cases
    need to to avoid losing wakeups.
    Suggested-by: NWaiman Long <waiman.long@hpe.com>
    Tested-by: NJason Low <jason.low2@hpe.com>
    Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: NIngo Molnar <mingo@kernel.org>
    5bbd7e64
mutex.c 26.1 KB