Re: [PATCH 1/2] kthread_create

From: Rusty Russell
Date: Thu Jan 01 2004 - 18:36:39 EST


In message <Pine.LNX.4.44.0312302255080.1457-100000@xxxxxxxxxxxxxxxxxxxxxxx> you write:
> On Wed, 31 Dec 2003, Srivatsa Vaddagiri wrote:
>
> > The messages should not be lost because we take the cpucontrol
> > semaphore in kthread_start or kthread_destroy before sending
> > a (start or destroy) message.
>
> I see, ok. At that point though, having the message struct inside the task
> struct could save the *to pointer and (because of the big lock above), using
> barrier and proper order in setting *from and *info, the spin lock.

My original version used barriers. But IMHO if you're using barriers
and your code isn't speed-critical, you don't have enough locks.

So I just threw a spinlock around the struct, and no more barrier
issues.

Cheers,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/