public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Richard Henderson <rth@twiddle.net>
Cc: torvalds@transmeta.com, matthew@hairy.beasts.org,
	bcrl@redhat.com, david@mysql.com, wli@holomorphy.com,
	linux-kernel@vger.kernel.org, frankeh@watson.ibm.com
Subject: Re: [PATCH] Fast Userspace Mutexes III.
Date: Thu, 07 Mar 2002 20:17:16 +1100	[thread overview]
Message-ID: <E16iu1V-0007a0-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Thu, 07 Mar 2002 00:48:21 -0800." <20020307004821.A26624@twiddle.net>

In message <20020307004821.A26624@twiddle.net> you write:
> On Thu, Mar 07, 2002 at 02:39:47PM +1100, Rusty Russell wrote:
> > But since the real problem here is "lock held forever", so I don't care.
> 
> No, "lock held forever" merely makes the example trivial.  
> "Lock held for a while" is the real problem.
> 
> > > You really do need that cmpxchg loop.
> > 
> > Well, not decrementing if count < 0 already also works
> 
> How, exactly, are you planning on doing that atomically?
> Clue: 386 SMP requires an extra spinlock.

Fortuntely, it doesn't need to be atomic.  This got me too, but Paul
Mackerras convinced me.

We don't care if someone decrements it between us checking < 0 and
doing the atomic_dec_and_test.  So the only thing we worry about is
the "up" case.  A userspace "up" will go into the kernel (since count
< 0), and the kernel "up" will wake us since we are on the queue
before we do this test.

> > PS. Will Alpha have to do any special magic with the mmap PROT_SEM flag?
> 
> No.

Damn, I was hoping to find out which arch actually is going to use
this.  I hate untested code.

Thanks!
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

      reply	other threads:[~2002-03-07  9:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-04  3:55 [PATCH] Fast Userspace Mutexes III Rusty Russell
2002-03-04 19:49 ` Robert Love
2002-03-04 20:13   ` Davide Libenzi
2002-03-04 20:20     ` Matthew Kirkwood
2002-03-04 20:48     ` Hubertus Franke
2002-03-04 22:15       ` Davide Libenzi
2002-03-05  1:50         ` Robert Love
2002-03-05  2:53           ` Davide Libenzi
2002-03-05  3:45           ` Rusty Russell
2002-03-05  3:55             ` Davide Libenzi
2002-03-05  6:11               ` Rusty Russell
2002-03-05 17:23                 ` Davide Libenzi
2002-03-05 15:09             ` Hubertus Franke
2002-03-05  4:30           ` Edgar Toernig
2002-03-07  1:58         ` Richard Henderson
2002-03-07  2:10           ` Davide Libenzi
2002-03-05  4:48       ` Rusty Russell
2002-03-05 15:15         ` Hubertus Franke
2002-03-06  1:31           ` Rusty Russell
2002-03-05  1:34   ` Rusty Russell
2002-03-07  1:52 ` Richard Henderson
2002-03-07  3:39   ` Rusty Russell
2002-03-07  8:48     ` Richard Henderson
2002-03-07  9:17       ` Rusty Russell [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=E16iu1V-0007a0-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=bcrl@redhat.com \
    --cc=david@mysql.com \
    --cc=frankeh@watson.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@hairy.beasts.org \
    --cc=rth@twiddle.net \
    --cc=torvalds@transmeta.com \
    --cc=wli@holomorphy.com \
    /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