Re: [PATCH] kernel/futex.c: Uneeded memory barrier

From: Felipe W Damasio
Date: Fri Sep 12 2003 - 13:37:03 EST


It is easier to review the patch if you can actually read the patch ;)

Felipe

Felipe W Damasio wrote:
Hi Rusty,

Patch against 2.6-test5.

Kills an unneeded set_current_state after schedule_timeout, since it already guarantees that the task will be TASK_RUNNING.

Also, when setting the state to TASK_RUNNING, isn't that memory barrier unneeded? Patch removes this memory barrier too.

If it looks good, please consider applying.

Thanks.

Felipe

--- linux-2.6.0-test5/kernel/futex.c.orig 2003-09-12 15:14:42.000000000 -0300
+++ linux-2.6.0-test5/kernel/futex.c 2003-09-12 15:14:56.000000000 -0300
@@ -381,13 +381,12 @@
* We were woken already.
*/
spin_unlock(&futex_lock);
- set_current_state(TASK_RUNNING);
+ __set_current_state(TASK_RUNNING);
return 0;
}

spin_unlock(&futex_lock);
time = schedule_timeout(time);
- set_current_state(TASK_RUNNING);

/*
* NOTE: we don't remove ourselves from the waitqueue because