[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1213250825.31518.80.camel@twins>
Date: Thu, 12 Jun 2008 08:07:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Daniel Walker <dwalker@...sta.com>
Cc: linux-kernel@...r.kernel.org, Ulrich Drepper <drepper@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Arjan van de Ven <arjan@...radead.org>
Subject: Re: [PATCH 5/5] futex: fix miss ordered wakeups
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists