Skip to contentSkip to conversation

Missing memory barrier on net/core/dev.c

PATCH In review Felipe W Damasio 2 participants 3 messages Sep 9, 2003 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Missing memory barrier on net/core/dev.c

Hi Dave,

I *think* net/core/dev.c is missing a mb() before calling
schedule_timoeut.

	Feel free to prove me wrong, though ;)

	Patch against 2.6.0-test5.

	Please review.

	Cheers,

Felipe

net/core/dev.c +2 -2
@@ -2753,9 +2753,9 @@
 			rebroadcast_time = jiffies;
 		}
 
-		current->state = TASK_INTERRUPTIBLE;
+		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ / 4);
-		current->state = TASK_RUNNING;
+		__set_current_state(TASK_RUNNING);
 
 		if (time_after(jiffies, warning_time + 10 * HZ)) {
 			printk(KERN_EMERG "unregister_netdevice: "
#1 lore raw
Quoted 2 lines · On Tue, 09 Sep 2003 14:58:47 -0300 Felipe W Damasio <[email protected]>…

I *think* net/core/dev.c is missing a mb() before calling
schedule_timoeut.

I have another patch in my queue from Andrew Morton that removes the TASK_RUNNING setting altogether, schedule_timeout() always returns with the task in that state.

#2 lore raw
	Hi,
Quoted 10 lines · David S. Miller
Quoted 2 lines · On Tue, 09 Sep 2003 14:58:47 -0300 Felipe W Damasio <[email protected]>…

I *think* net/core/dev.c is missing a mb() before calling
schedule_timoeut.

I have another patch in my queue from Andrew Morton that removes the TASK_RUNNING setting altogether, schedule_timeout() always returns with the task in that state.

Ok, although that was not the main point of the patch :)

What about the "set_current_state" before calling schedule_timeout.
Isn't that mb() needed?

Cheers,

Felipe