[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1328116594.1882.12.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Wed, 01 Feb 2012 18:16:34 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Dmitry Antipov <dmitry.antipov@...aro.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Module/kthread/printk question/problem
Le mercredi 01 février 2012 à 20:35 +0400, Dmitry Antipov a écrit :
> On 02/01/2012 08:31 PM, Eric Dumazet wrote:
>
> > Race is here :
> >
> > Here you allow testmod_exit() to continue, while _this_ thread has not
> > yet exited.
> >
> > And if this thread is preempted a litle bit, its code already was freed.
> > -> crash.
>
> I realize this, but there was a second part of the question: what's the
> better way to ensure that all test/X threads are really gone at some point of
> testmod_exit()?
>
You could use kthread_stop()
This way you can control all your kernel threads really exited before
module cleanup.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists