mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com
Subject: Re: [PATCH] Add FUTEX_CMP_REQUEUE futex op
Date: Fri, 21 May 2004 16:05:10 -0700	[thread overview]
Message-ID: <20040521160510.4214c7a3.akpm@osdl.org> (raw)
In-Reply-To: <20040520093817.GX30909@devserv.devel.redhat.com>

Jakub Jelinek <jakub@redhat.com> wrote:
>
> The patch below extends FUTEX_REQUEUE operation with something FUTEX_WAIT
> already uses:
> FUTEX_CMP_REQUEUE is passed an additional argument which is the expected
> value of *futex.  Kernel then while holding the futex locks checks if

                                      ^^^^^^^^^^^^^^^^^^^^^^^

But in your patch the check is happening _prior_ to taking the futex locks.

> *futex != expected and returns -EAGAIN in that case, while if it is equal,
> continues with a normal FUTEX_REQUEUE operation.
> If the syscall returns -EAGAIN, NPTL can fall back to FUTEX_WAKE INT_MAX
> operation which doesn't have this problem, but is less efficient, while
> in the likely case that nobody hit the (small) window the efficient
> FUTEX_REQUEUE operation is used.

You've added an smp_mb().  These things are becoming like lock_kernel() -
hard for the reader to discern what it's protecting against.

Please always include a comment when adding a barrier like this.

  parent reply	other threads:[~2004-05-21 23:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20  9:38 Jakub Jelinek
2004-05-20 22:52 ` Andrew Morton
2004-05-21  6:06   ` Ulrich Drepper
2004-05-21  6:36     ` Andrew Morton
2004-05-21  7:15       ` Ulrich Drepper
2004-05-21  7:43       ` Jakub Jelinek
2004-05-22 16:58         ` Arnd Bergmann
2004-05-24  7:34           ` Jakub Jelinek
2004-05-24  8:12             ` Andrew Morton
2004-05-24  8:19               ` Jakub Jelinek
2004-05-28 13:09                 ` DOCUMENTATION " bert hubert
2004-05-28 14:02                   ` Jakub Jelinek
2004-05-28 15:39                     ` bert hubert
2004-05-24  8:27               ` bert hubert
2004-05-24 17:34             ` Arnd Bergmann
2004-05-21  7:05   ` Ingo Molnar
2004-05-21 23:05 ` Andrew Morton [this message]
2004-05-22 10:10   ` Ingo Oeser
2004-05-23 17:33   ` Jakub Jelinek
2004-05-29  3:13 ` Rusty Russell
2004-06-07 16:03 Martin Schwidefsky
     [not found] <mailman.1086629984.12568.linux-kernel2news@redhat.com>
2004-06-09 20:04 ` Pete Zaitcev
2004-06-09 22:08   ` Arnd Bergmann
2004-06-11  8:35   ` Martin Schwidefsky

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=20040521160510.4214c7a3.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

all inboxes | Powered by JetHome®