From owner-cvs-src@FreeBSD.ORG Mon Sep 19 16:51:43 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C94B516A41F; Mon, 19 Sep 2005 16:51:43 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5771643D48; Mon, 19 Sep 2005 16:51:43 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8JGphqh060385; Mon, 19 Sep 2005 16:51:43 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8JGphxN060384; Mon, 19 Sep 2005 16:51:43 GMT (envelope-from rwatson) Message-Id: <200509191651.j8JGphxN060384@repoman.freebsd.org> From: Robert Watson Date: Mon, 19 Sep 2005 16:51:43 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/alpha/alpha trap.c src/sys/alpha/osf1 osf1_ioctl.c osf1_misc.c osf1_signal.c src/sys/amd64/amd64 trap.c src/sys/compat/linux linux_socket.c src/sys/compat/svr4 svr4_fcntl.c svr4_ioctl.c svr4_ipc.c svr4_misc.c svr4_signal.c ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2005 16:51:44 -0000 rwatson 2005-09-19 16:51:43 UTC FreeBSD src repository Modified files: sys/alpha/alpha trap.c sys/alpha/osf1 osf1_ioctl.c osf1_misc.c osf1_signal.c sys/amd64/amd64 trap.c sys/compat/linux linux_socket.c sys/compat/svr4 svr4_fcntl.c svr4_ioctl.c svr4_ipc.c svr4_misc.c svr4_signal.c svr4_stat.c svr4_stream.c svr4_termios.c svr4_ttold.c svr4_util.h sys/gnu/fs/ext2fs ext2_alloc.c sys/i386/i386 trap.c vm86.c sys/ia64/ia64 unaligned.c sys/kern imgact_elf.c subr_prf.c sys/nfsclient nfs_socket.c sys/rpc rpcclnt.c sys/ufs/ffs ffs_alloc.c Log: 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 Revision Changes Path 1.124 +2 -0 src/sys/alpha/alpha/trap.c 1.14 +4 -0 src/sys/alpha/osf1/osf1_ioctl.c 1.57 +4 -0 src/sys/alpha/osf1/osf1_misc.c 1.41 +24 -6 src/sys/alpha/osf1/osf1_signal.c 1.291 +2 -0 src/sys/amd64/amd64/trap.c 1.60 +2 -0 src/sys/compat/linux/linux_socket.c 1.36 +4 -2 src/sys/compat/svr4/svr4_fcntl.c 1.23 +2 -0 src/sys/compat/svr4/svr4_ioctl.c 1.18 +2 -0 src/sys/compat/svr4/svr4_ipc.c 1.81 +2 -0 src/sys/compat/svr4/svr4_misc.c 1.34 +4 -1 src/sys/compat/svr4/svr4_signal.c 1.21 +2 -0 src/sys/compat/svr4/svr4_stat.c 1.55 +26 -2 src/sys/compat/svr4/svr4_stream.c 1.13 +9 -0 src/sys/compat/svr4/svr4_termios.c 1.15 +24 -0 src/sys/compat/svr4/svr4_ttold.c 1.10 +4 -1 src/sys/compat/svr4/svr4_util.h 1.43 +2 -0 src/sys/gnu/fs/ext2fs/ext2_alloc.c 1.279 +2 -0 src/sys/i386/i386/trap.c 1.58 +2 -0 src/sys/i386/i386/vm86.c 1.12 +4 -0 src/sys/ia64/ia64/unaligned.c 1.164 +6 -0 src/sys/kern/imgact_elf.c 1.119 +8 -0 src/sys/kern/subr_prf.c 1.130 +13 -1 src/sys/nfsclient/nfs_socket.c 1.14 +8 -1 src/sys/rpc/rpcclnt.c 1.133 +6 -0 src/sys/ufs/ffs/ffs_alloc.c