[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1703071516080.3584@nanos>
Date: Tue, 7 Mar 2017 15:18:46 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: mingo@...nel.org, juri.lelli@....com, rostedt@...dmis.org,
xlpang@...hat.com, bigeasy@...utronix.de,
linux-kernel@...r.kernel.org, mathieu.desnoyers@...icios.com,
jdesfossez@...icios.com, bristot@...hat.com, dvhart@...radead.org
Subject: Re: [PATCH -v5 12/14] futex,rt_mutex: Restructure
rt_mutex_finish_proxy_lock()
On Sat, 4 Mar 2017, Peter Zijlstra wrote:
> +/**
> + * rt_mutex_cleanup_proxy_lock() - Cleanup failed lock acquisition
> + * @lock: the rt_mutex we were woken on
> + * @waiter: the pre-initialized rt_mutex_waiter
> + *
> + * Clean up the failed lock acquisition as per rt_mutex_wait_proxy_lock().
> + *
> + * Returns:
> + * true - did the cleanup, we done.
> + * false - we acquired the lock after rt_mutex_wait_proxy_lock() returned,
> + * caller should disregards its return value.
Hmm. How would that happen? Magic owner assignement to a non waiter? The
callsite only calls here in the failed case.
I must be missing something
Thanks,
tglx
> + *
> + * Special API call for PI-futex support
> + */
> +bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock,
> + struct rt_mutex_waiter *waiter)
> +{
> + bool cleanup = false;
> +
> + raw_spin_lock_irq(&lock->wait_lock);
> + /*
> + * If we acquired the lock, no cleanup required.
> + */
> + if (rt_mutex_owner(lock) != current) {
> + remove_waiter(lock, waiter);
> + fixup_rt_mutex_waiters(lock);
> + cleanup = true;
> + }
> + raw_spin_unlock_irq(&lock->wait_lock);
> +
> + return cleanup;
> +}
Powered by blists - more mailing lists