freebsd-skq/sys/compat
Robert Watson 84d2b7df26 Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),
as they both interact with the tty code (!MPSAFE) and may sleep if the
tty buffer is full (per comment).

Modify all consumers of uprintf() and tprintf() to hold Giant around
calls into these functions.  In most cases, this means adding an
acquisition of Giant immediately around the function.  In some cases
(nfs_timer()), it means acquiring Giant higher up in the callout.

With these changes, UFS no longer panics on SMP when either blocks are
exhausted or inodes are exhausted under load due to races in the tty
code when running without Giant.

NB: Some reduction in calls to uprintf() in the svr4 code is probably
desirable.

NB: In the case of nfs_timer(), calling uprintf() while holding a mutex,
or even in a callout at all, is a bad idea, and will generate warnings
and potential upset.  This needs to be fixed, but was a problem before
this change.

NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having
non-MPSAFE tty code.

MFC after:	1 week
2005-09-19 16:51:43 +00:00
..
freebsd32 Regen. 2005-07-13 20:35:09 +00:00
ia32 Jumbo-commit to enhance 32 bit application support on 64 bit kernels. 2005-06-30 07:49:22 +00:00
linprocfs Always produce cpuX entries, even in the case when there is only one CPU 2005-03-06 22:28:14 +00:00
linux Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), 2005-09-19 16:51:43 +00:00
ndis Test the mbuf flags against the correct constant. The previous version 2005-08-30 16:21:51 +00:00
netbsd Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
pecoff remove dead code 2005-02-22 01:26:48 +00:00
svr4 Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), 2005-09-19 16:51:43 +00:00