public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jamie Lokier <jamie@shareable.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Hugh Dickins <hugh@veritas.com>,
	Ulrich Drepper <drepper@redhat.com>,
	Andrew Morton <akpm@osdl.org>,
	Stephen Hemminger <shemminger@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Make futex waiters take an mm or inode reference
Date: Tue, 09 Sep 2003 14:02:15 +1000	[thread overview]
Message-ID: <20030909040403.B97352C0F0@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 08 Sep 2003 11:52:07 MST." <Pine.LNX.4.44.0309081144390.3202-100000@home.osdl.org>

In message <Pine.LNX.4.44.0309081144390.3202-100000@home.osdl.org> you write:
> So is there any reason to really having "private.mm" AT ALL? From what I
> can tell, it is not actually ever used (all "mm" users are "current->mm"),
> so I don't see the point of incrementing a count for it either.
> 
> Or did I miss something?

Yes.  Firstly, you can't do "wake one" if the one you wake might be
some completely unrelated process which happens to use the same
address.  Secondly, I implemented fair futexes by relying on the
return value of FUTEX_WAKE to indicate how many people were woken: you
set the futex to a magic value, call FUTEX_WAKE(1), and if it returns
1, you've "passed" the futex directly, otherwise you unlock the futex
like normal.  This is surprisingly useful for implementing
"drop_futex_if_someone_is_waiting()" in cleanup threads etc.

Sorry,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

      parent reply	other threads:[~2003-09-09  4:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-08 18:20 [PATCH] Make futex waiters take an mm or inode reference Jamie Lokier
2003-09-08 18:34 ` Jamie Lokier
2003-09-08 18:52   ` Linus Torvalds
2003-09-08 20:00     ` Jamie Lokier
2003-09-09  4:02     ` 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=20030909040403.B97352C0F0@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@osdl.org \
    --cc=drepper@redhat.com \
    --cc=hugh@veritas.com \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=torvalds@osdl.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