[lkml]   [2002]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectkernel thread exit race

what is the politically correct way to exit from a kernel thread daemon
without module unload races?

Currently most kernel threads exit with something like

return 0;

(or complete() in stead of wake_up()). Problem is that thread waiting
for daemon shutdown can start running on another CPU while daemon is
still executing and unload module, in particular unmapping page with
daemon code.

Reiserfs used to do something like

* BKL will be released in do_exit()
return 0;

and wait for daemon completion under BKL so that when waiter resumes,
daemon is definitely not executing module code. This looks like a hack,
though. Is there a better solution?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:27    [W:0.070 / U:58.920 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site