mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Sébastien Dugué" <sebastien.dugue@bull.net>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@linutronix.de
Subject: Re: [RFC][PATCH RT 1/2] futex_requeue-optimize
Date: Thu, 11 May 2006 09:15:41 -0700	[thread overview]
Message-ID: <20060511091541.05160b2c.akpm@osdl.org> (raw)
In-Reply-To: <20060510112701.7ea3a749@frecb000686>

Sébastien Dugué <sebastien.dugue@bull.net> wrote:
>
> 
> 
>   In futex_requeue(), when the 2 futexes keys hash to the same bucket, there
> is no need to move the futex_q to the end of the bucket list.
> 
> ...
> 
> Index: linux-2.6.16-rt20/kernel/futex.c
> ===================================================================
> --- linux-2.6.16-rt20.orig/kernel/futex.c	2006-05-04 10:58:38.000000000 +0200
> +++ linux-2.6.16-rt20/kernel/futex.c	2006-05-04 10:58:55.000000000 +0200
> @@ -835,17 +835,20 @@ static int futex_requeue(u32 __user *uad
>  		if (++ret <= nr_wake) {
>  			wake_futex(this);
>  		} else {
> -			list_move_tail(&this->list, &hb2->chain);
> -			this->lock_ptr = &hb2->lock;
> +			/*
> +			 * If key1 and key2 hash to the same bucket, no
> +			 * need to requeue.
> +			 */
> +			if (likely(head1 != &hb2->chain)) {
> +				list_move_tail(&this->list, &hb2->chain);
> +				this->lock_ptr = &hb2->lock;
> +			}
>  			this->key = key2;
>  			get_key_refs(&key2);
>  			drop_count++;
>  
>  			if (ret - nr_wake >= nr_requeue)
>  				break;
> -			/* Make sure to stop if key1 == key2: */
> -			if (head1 == &hb2->chain && head1 != &next->list)
> -				head1 = &this->list;
>  		}
>  	}

For some reason I get a reject when applying this.  Which is odd, because I
see no differences in there.  Oh well - please try to work out what went
wrong and double-check that the patch which I applied still makes sense.

Should the futex code be using hlist_heads for that hashtable?

  reply	other threads:[~2006-05-11 16:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10  9:27 Sébastien Dugué
2006-05-11 16:15 ` Andrew Morton [this message]
2006-05-12  6:32   ` Ingo Molnar
2006-05-12  8:10     ` Sébastien Dugué
2006-05-12 11:13       ` Sébastien Dugué
2006-05-12 11:12         ` Ingo Molnar
2006-05-12 13:16           ` Sébastien Dugué
2006-05-12 13:40             ` Ingo Molnar
2006-05-12  8:09   ` Sébastien Dugué

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=20060511091541.05160b2c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sebastien.dugue@bull.net \
    --cc=tglx@linutronix.de \
    /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®