From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: mingo@kernel.org, Waiman.Long@hpe.com,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] spinlock: Get rid of spin_can_lock()
Date: Tue, 24 May 2016 12:21:26 +0200 [thread overview]
Message-ID: <20160524102126.GT3193@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1464011642-29168-1-git-send-email-dave@stgolabs.net>
On Mon, May 23, 2016 at 06:54:02AM -0700, Davidlohr Bueso wrote:
> ... it has no users and we already have the the regular spin_is_lock()
> call anyway -- although iirc this was going to be different
> than the simple negation for lock elision implementations. Lets drop it.
>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
> include/linux/spinlock.h | 11 -----------
> 1 file changed, 11 deletions(-)
>
> diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
> index 47dd0cebd204..047c6f6c3268 100644
> --- a/include/linux/spinlock.h
> +++ b/include/linux/spinlock.h
> @@ -264,12 +264,6 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
> 1 : ({ local_irq_restore(flags); 0; }); \
> })
>
> -/**
> - * raw_spin_can_lock - would raw_spin_trylock() succeed?
> - * @lock: the spinlock in question.
> - */
> -#define raw_spin_can_lock(lock) (!raw_spin_is_locked(lock))
Its also complete crack; there's absolutely no guarantee the trylock
would still succeed the instruction after we do this.
The only way to test if the trylock would work is actually doing it.
So yeah, queued and killed.
next prev parent reply other threads:[~2016-05-24 10:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 13:54 Davidlohr Bueso
2016-05-24 10:21 ` Peter Zijlstra [this message]
2016-06-01 12:45 ` Peter Zijlstra
2016-06-06 17:27 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160524102126.GT3193@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Waiman.Long@hpe.com \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome