lkml.org 
[lkml]   [2008]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] pktgen: make sure that pktgen_thread_worker has been executed
From
Date
On Tue, 2008-05-20 at 20:30 +0200, Robert Olsson wrote:
> Denis V. Lunev writes:
>
> > The problem is that pktgen_thread_worker can not be executed if kthread_stop
> > has been called too early. Insert a completion on the normal initialization
> > path to make sure that pktgen_thread_worker will gain the control for sure.
>
>
> Yes how about if we move the wait_for_completion() to pg_cleanup before
> we remove the threads. And move the complete() last in pktgen_thread_worker.
> This completion would sync with both start and stop.
>
> Cheers.
> --ro

you can't. The idea is to have a checkpoint _before_ khread_stop.
Currently you have a race between


static int kthread(void *_create)
{
...
if (!kthread_should_stop())
pktgen_thread_worker();
...
}

and kthread_stop. If kthread_stop will be called _before_ the control
goes inside pktgen_thread_worker you'll OOPS.

Regards,
Den



\
 
 \ /
  Last update: 2008-05-20 20:47    [W:0.610 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site