public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Nick Piggin <npiggin@suse.de>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch][rfc] x86, mutex: non-atomic unlock (and a rant)
Date: Mon, 2 Nov 2009 21:09:59 +0300	[thread overview]
Message-ID: <20091102180959.GC10072@lenovo> (raw)
In-Reply-To: <20091102164626.GA10072@lenovo>

[Cyrill Gorcunov - Mon, Nov 02, 2009 at 07:46:26PM +0300]
| 
| The other option could be that we put two mem-write operations
| like
| 	int tmp;
| 	atomic_set(&lock->count, 1);
| 	tmp = lock->waiters;
| 	rmb();
| 	lock->waiters = tmp;
| 	if (unlikely(lock->waiters))
| 		fail_fn(lock);
| 
| Which should work faster then cpuid (and we have to be sure somehow
| that gcc doesn't suppress this redundant operations).
|

And which has nothing to do with OoO mem-read, and wouldn't
work. Sorry for noise.
 
	-- Cyrill

      reply	other threads:[~2009-11-02 18:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 12:07 [patch][rfc] x86, mutex: non-atomic unlock (and a rant) Nick Piggin
2009-11-02 15:20 ` Linus Torvalds
2009-11-02 16:00   ` Nick Piggin
2009-11-02 16:46   ` Cyrill Gorcunov
2009-11-02 18:09     ` Cyrill Gorcunov [this message]

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=20091102180959.GC10072@lenovo \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=torvalds@linux-foundation.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