Lines Matching refs:ctx
190 DEBUG_LOCKS_WARN_ON(ww->ctx);
218 ww->ctx = ww_ctx;
273 * already (ctx->acquired > 0), because __ww_mutex_add_waiter() and
374 * After acquiring lock with fastpath, where we do not hold wait_lock, set ctx
378 ww_mutex_set_context_fastpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
380 ww_mutex_lock_acquired(lock, ctx);
383 * The lock->ctx update should be visible on all cores before
392 * [W] ww->ctx = ctx [W] MUTEX_FLAG_WAITERS
394 * [R] MUTEX_FLAG_WAITERS [R] ww->ctx
397 * __ww_mutex_add_waiter() and makes sure we either observe ww->ctx
408 __ww_mutex_check_waiters(&lock->base, ctx);
442 struct ww_acquire_ctx *ctx)
445 struct ww_acquire_ctx *hold_ctx = READ_ONCE(ww->ctx);
448 if (ctx->acquired == 0)
451 if (!ctx->is_wait_die) {
452 if (ctx->wounded)
453 return __ww_mutex_kill(lock, ctx);
458 if (hold_ctx && __ww_ctx_less(ctx, hold_ctx))
459 return __ww_mutex_kill(lock, ctx);
471 return __ww_mutex_kill(lock, ctx);
549 * MUTEX_FLAG_WAITERS vs the ww->ctx load,
550 * such that either we or the fastpath will wound @ww->ctx.
553 __ww_mutex_wound(lock, ww_ctx, ww->ctx);
561 if (lock->ctx) {
563 DEBUG_LOCKS_WARN_ON(!lock->ctx->acquired);
565 if (lock->ctx->acquired > 0)
566 lock->ctx->acquired--;
567 lock->ctx = NULL;