public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Walker <dwalker@mvista.com>
Cc: linux-kernel@vger.kernel.org, Ulrich Drepper <drepper@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH 5/5] futex: fix miss ordered wakeups
Date: Thu, 12 Jun 2008 08:07:05 +0200	[thread overview]
Message-ID: <1213250825.31518.80.camel@twins> (raw)
In-Reply-To: <20080611204917.523866467@mvista.com>

On Wed, 2008-06-11 at 13:49 -0700, Daniel Walker wrote:
> plain text document attachment (blocked_on-futex.patch)

I thought everybody and his dog didn't care for this?

> +void futex_adjust_waiters(struct task_struct *p)
> +{
> +

Seemingly extra whitespace ^

> +	if (p->blocked_on) {
> +		struct futex_hash_bucket *hb;
> +		struct futex_q *q, *next;
> +		union futex_key key;
> +
> +		spin_lock_irq(&p->pi_lock);
> +		if (p->blocked_on && p->blocked_on->lock_type == FUTEX_WAITER) {
> +			key = *p->blocked_on->futex_blocked_on;
> +			spin_unlock_irq(&p->pi_lock);
> +		} else {
> +			spin_unlock_irq(&p->pi_lock);
> +			return;
> +		}
> +
> +		hb = hash_futex(&key);
> +		spin_lock(&hb->lock);
> +		plist_for_each_entry_safe(q, next, &hb->chain, list) {
> +			if (match_futex(&q->key, &key) && q->task == p) {
> +				int prio = min(p->normal_prio, MAX_RT_PRIO);
> +				plist_del(&q->list, &hb->chain);
> +				plist_node_init(&q->list, prio);
> +				plist_add(&q->list, &hb->chain);
> +				break;
> +			}
> +		}
> +		spin_unlock(&hb->lock);
> +	}
> +}

Also, if you write it like:

  if (!p->blocked_on)
    return

  do_other_stuff

you loose one nesting level - which imho looks better.


  reply	other threads:[~2008-06-12  6:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11 20:49 [PATCH 1/5] futex: checkpatch cleanup Daniel Walker
2008-06-11 20:49 ` [PATCH 2/5] futex: update prio on requeue Daniel Walker
2008-06-12  5:22   ` Peter Zijlstra
2008-06-11 20:49 ` [PATCH 3/5] mutex debug: add generic blocked_on usage Daniel Walker
2008-06-12  5:25   ` Peter Zijlstra
2008-06-12 13:21     ` Daniel Walker
2008-06-11 20:49 ` [PATCH 4/5] rtmutex: " Daniel Walker
2008-06-11 20:49 ` [PATCH 5/5] futex: fix miss ordered wakeups Daniel Walker
2008-06-12  6:07   ` Peter Zijlstra [this message]
2008-06-12 13:22     ` Daniel Walker
2008-06-12 13:57       ` Peter Zijlstra
2008-06-12 14:04         ` Daniel Walker
2008-06-12  8:56   ` Thomas Gleixner
2008-06-12 13:30     ` Daniel Walker
2008-06-12 13:33       ` Thomas Gleixner
2008-06-12 13:44         ` Daniel Walker
2008-06-12 15:24           ` Thomas Gleixner
2008-06-12 15:56             ` Daniel Walker
2008-06-12 19:55               ` Thomas Gleixner
2008-06-12 22:09                 ` Daniel Walker
2008-06-12 22:43                   ` Thomas Gleixner
2008-06-12 23:06                     ` Daniel Walker
2008-06-12 23:30                       ` Thomas Gleixner

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=1213250825.31518.80.camel@twins \
    --to=peterz@infradead.org \
    --cc=arjan@infradead.org \
    --cc=drepper@gmail.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --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