diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-09-19 16:51:43 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-09-19 16:51:43 +0000 |
commit | c479a90eb8129ad770ff6daba981e9f20af69e6f (patch) | |
tree | e3c313c0b77fbcc1f434ec162a95a06a9e05a773 /sys/compat/linux/linux_socket.c | |
parent | 745da316335f104d267ad6c4b565be45311e5d6e (diff) | |
download | FreeBSD-src-c479a90eb8129ad770ff6daba981e9f20af69e6f.zip FreeBSD-src-c479a90eb8129ad770ff6daba981e9f20af69e6f.tar.gz |
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
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
-rw-r--r-- | sys/compat/linux/linux_socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index f1f26bc..b5d7f2b 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1187,7 +1187,9 @@ linux_socketcall(struct thread *td, struct linux_socketcall_args *args) return (linux_recvmsg(td, arg)); } + mtx_lock(&Giant); uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); + mtx_unlock(&Giant); return (ENOSYS); } #endif /*!__alpha__*/ |