2003-09-09 19:50:19

by Felipe W Damasio

[permalink] [raw]
Subject: [PATCH] Missing memory barrier on net/core/dev.c

--- linux-2.6.0-test5/net/core/dev.c Mon Sep 8 16:50:06 2003
+++ linux-2.6.0-test5-fwd/net/core/dev.c Tue Sep 9 14:52:48 2003
@@ -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: "


Attachments:
net-core-current_state.patch (475.00 B)

2003-09-09 19:57:24

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] Missing memory barrier on net/core/dev.c

On Tue, 09 Sep 2003 14:58:47 -0300
Felipe W Damasio <[email protected]> wrote:

> 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.

2003-09-09 21:03:22

by Felipe W Damasio

[permalink] [raw]
Subject: Re: [PATCH] Missing memory barrier on net/core/dev.c

Hi,

David S. Miller wrote:
> On Tue, 09 Sep 2003 14:58:47 -0300
> Felipe W Damasio <[email protected]> wrote:
>
>
>> 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