lkml.org 
[lkml]   [2009]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kthread: Don't looking for a task in create_kthread() #2
On 01/20, Vitaliy Gusev wrote:
>
> Ok, I understand you. You want to decrease kthreadd latency. In this case
> your suggestion is right.

Please feel free to send the patch then.

> > OK, please forget. This reminds me kthread.c needs a major rework
> > anyway, hopefully I'll try to do this soon.
>
> I also have intent to make kthread_run/kthread_create more easy used for
> threads that exit himself on error.
> For example, we create some thread THR, which does something but exits on error.
> So in normal case we need to call kthread_stop() to stop thread THR, but on
> error we don't. This is a problem, because we can't simple (without race)
> determine that THR was exited.

This is only one of the problems,

> Simple workaround - do a sleeping loop in thread THR and don't exit until kthread_should_stop.
> But it isn't a good for code reading/writing.
>
> So my suggestion is: Move workaround sleeping logic from THR to low level
> functions:
> wait for a kthread_should_stop in kthread() if THR was exited.

I think it is better to improve kthread_stop() so it can be used even
if kthread has already exited, this is not that hard.

But there are other problems, I'll try to provide mor info later.

Oleg.



\
 
 \ /
  Last update: 2009-01-21 16:39    [W:0.057 / U:1.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site