[lkml]   [2022]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: re. Spurious wakeup on a newly created kthread
On Sat 2022-06-25 10:01:35, Linus Torvalds wrote:
> On Fri, Jun 24, 2022 at 10:00 PM Tejun Heo <> wrote:
> For example, the reason that quoted patch cannot be right is that this
> code pattern:
> while (wait_for_completion_interruptible(&worker->ready_to_start))
> ;
> is not valid kernel code. EVER. There is absolutely no way that can be correct.
> Either that code can take a signal, or it cannot. If it can take a
> signal, it had better react to said signal. If it cannot, it must not
> use an interruptble sleep - since now that loop turned into a
> kernel-side busy-loop.

I agree that the code is ugly and does not make sense.

JFYI, I did it this way because I wanted to calm down the hung task
detector. kthreads ignore signals so that I did not think about
this aspect. I though that I saw this trick somewhere.

Do not ask me why I wanted to calm down the hung task detector.
I quess that I felt overloaded and wished a calm day
or something like this. I agree that it does not make
much sense.

Best Regards,

 \ /
  Last update: 2022-06-28 11:52    [W:0.146 / U:3.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site