Date: Fri, 06 Oct 2000 10:52:38 -0600 From: Chuck Paterson <cp@bsdi.com> To: freebsd-smp@freebsd.org Subject: Kernel printf Was: Problems with kthread_exit() and SMPng Message-ID: <200010061652.KAA14529@berserker.bsdi.com> In-Reply-To: Your message of "Fri, 06 Oct 2000 12:30:53 %2B0200." <20001006123053.A42012@cicely5.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
There is no single mutex you can grab and be safe. If the printf is coming from some place with a spin lock you can't grab a sleep lock to protect. You can't hold a spin lock while you call into the output routines. Furthermore you really don't know that you won't introduce a lock ordering problem. Just grabbing Giant isn't even safe in the short term because there can be lock ordering problems. If you queue and then do the output with a soft interrupt you should get output immediately. The cases were you don't is from the bottom half, when a mutex is held someplace else that prevents the output from occurring, or the current thread has its effective priority raised for some reason, such as holding a spin lock. This would seem to meet all the real needs and is only a minor PITA to implement. Chuck 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?200010061652.KAA14529>