Date: Thu, 05 Oct 2000 14:31:07 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: Boris Popov <bp@butya.kz> Cc: freebsd-smp@FreeBSD.org, freebsd-current@FreeBSD.org Subject: RE: Problems with kthread_exit() and SMPng Message-ID: <XFMail.001005143107.jhb@FreeBSD.org> In-Reply-To: <Pine.BSF.4.10.10010051724260.43806-200000@lion.butya.kz>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05-Oct-00 Boris Popov wrote: > Hello, > > Currently I'm trying to make KLD which uses kernel threads > unloadable under recent -current. The prototype of functions looks like > this: > > void > my_thread(void*arg) > { > while(wearewanted) { > do_something(); > tsleep(); > } > exited = 1; > kthread_exit(0); > } > > void > my_unload() > { > wearewanted = 0; > while (!exited) > tsleep(1sec); > } > > my_unload() function called from the module unload event which > issued from the kldunload() syscall. > > Unfortunately, kernel panics in the mtx_exit_hard() function. > After some examination I've found that two fields in the Giant mutex > structure set to unexpected values: > ---- > empty mtx_blocked for mutex Giant > mtx_contested not in any list for mutex Giant > ---- > > These messages printed by added diagnostics code. With this patch > (see attachment) it is possible to load and unload KLD without any > problems on UP machine except that the above messages printed. However, > I'm don't know if they are correct. (btw, 4.1 doesn't have this problem). > > Any ideas why this happened and how to fix it ? > -- > Boris Popov > http://www.butya.kz/~bp/ -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001005143107.jhb>