Re: [PATCH V3] futex: add futex_q static initializer

From: Darren Hart
Date: Mon Nov 08 2010 - 16:59:11 EST


On 11/08/2010 01:48 PM, Thomas Gleixner wrote:
On Mon, 8 Nov 2010, Darren Hart wrote:

/*
* Hash buckets are shared by all the futex_keys that hash to the same
* location. Each key may have multiple futex_q structures, one for each task
@@ -1751,7 +1757,6 @@ static int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
* rare, but normal.
*/
retry:
- q->key = FUTEX_KEY_INIT;

You sure about that one in the retry path ?

@@ -1906,11 +1907,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, int detect,
hrtimer_set_expires(&to->timer, *time);
}

- q.pi_state = NULL;
- q.rt_waiter = NULL;
- q.requeue_pi_key = NULL;
retry:
- q.key = FUTEX_KEY_INIT;

Ditto

Yes, these are fine. get_futex_key (called immediately after retry: in both cases) will set the mm or inode or error out. On error we return immediately. No need to zero both.ptr.

Thanks,

--
Darren Hart
Embedded Linux Kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/