From owner-freebsd-current Sun Jul 1 18:21:46 2001 Delivered-To: freebsd-current@freebsd.org Received: from nasu.utsunomiya-u.ac.jp (nasu.utsunomiya-u.ac.jp [160.12.128.3]) by hub.freebsd.org (Postfix) with ESMTP id DCEE437B401 for ; Sun, 1 Jul 2001 18:21:42 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from nantai.utsunomiya-u.ac.jp by nasu.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/26Jan01-1134AM) id f621L4d424992; Mon, 2 Jul 2001 10:21:04 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp by nantai.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/30Jan01-0241PM) id f621L4D373144; Mon, 2 Jul 2001 10:21:04 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:EADZdvevhiEjVpbmVsd9Ti7XOAif69XN@zodiac.mech.utsunomiya-u.ac.jp [160.12.43.7]) by zodiac.mech.utsunomiya-u.ac.jp (8.9.3+3.2W/3.7W/zodiac-May2000) with ESMTP id KAA23158; Mon, 2 Jul 2001 10:30:37 +0900 (JST) Message-Id: <200107020130.KAA23158@zodiac.mech.utsunomiya-u.ac.jp> To: Bruce Evans Cc: Dag-Erling Smorgrav , current@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: blockable sleep lock panic (and dumps still don't work) In-reply-to: Your message of "Mon, 02 Jul 2001 03:45:19 +1000." References: Date: Mon, 02 Jul 2001 10:30:36 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >This has something to do with the TIOCCONS ioctl. tputchar() is the >output function for the TOTTY case, and the TOTTY flag is only set for >kernel printfs if TIOCCONS has set constty to non-NULL. I'm not sure >what uses TIOCCONS (I think it is intended for use with X, but it >doesn't seem to be used on my systems). IIRC, xconsole uses this to capture console output. >TIOCCONS is almost unimplementable >(printing to a terminal is not reentrant enough to work in all contexts, >and is supposed to be protected by spltty(), but kernel printfs must >work in all contexts), so the correct fix may be to remove it. TIOCCONS >is broken in all versions of FreeBSD. The brokenness is just more >obvious now that there are more locks to trip over. > >The output function for the TOLOG case (i.e., msglogchar()) also seems to >be broken in all versions of FreeBSD. It operates on the circular message >buffer, but doesn't have any locking. I discussed this with jhb. We even had a test patch. Jhb told me that someone else was working on providing proper locking in kernel printf(). >The output function for the TOCONS case (i.e., cnputc()) is also >problematic. Only the serial console output routine even attempts to >be reentrant, and (per-cpu) reentrancy is not enough under SMP. >Syscons' output routine was easy to panic by mixing kernel printfs with >user-mode output the last time I checked. Syscons' sccnputc() is not reentrant. I was trying to improbe this, but decided that I would wait until I see further development in tty locking and kernel printf() area by jhb. Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message