From nobody@FreeBSD.org  Wed Feb 20 19:27:38 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 307AD16A402
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Feb 2008 19:27:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 17C5B13C442
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Feb 2008 19:27:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1KJP5cx055152
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Feb 2008 19:25:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1KJP5DL055151;
	Wed, 20 Feb 2008 19:25:05 GMT
	(envelope-from nobody)
Message-Id: <200802201925.m1KJP5DL055151@www.freebsd.org>
Date: Wed, 20 Feb 2008 19:25:05 GMT
From: Dominic Fandrey <kamikaze@bsdforen.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] proposed fix to rc.shutdown to turn off the mixed buffer messages with an rc.conf tuneable
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120914
>Category:       conf
>Synopsis:       [patch] proposed fix to rc.shutdown to turn off the mixed buffer messages with an rc.conf tuneable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 20 19:30:02 UTC 2008
>Closed-Date:    Mon Feb 25 18:28:28 UTC 2008
>Last-Modified:  Mon Feb 25 18:28:28 UTC 2008
>Originator:     Dominic Fandrey
>Release:        RELENG_7
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #3: Wed Feb 13 17:52:28 CET 2008     root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b  amd64
>Description:
On multicore machines several buffers simultaneously write to the screen and produce unreadable output.
>How-To-Repeat:
Apply the patch and add

shutdown_clean_enable="YES"

to your /etc/rc.conf.
>Fix:
--- rc.shutdown	2008-02-20 19:28:45.000000000 +0100
+++ /etc/rc.shutdown	2008-02-20 19:59:03.000000000 +0100
@@ -43,10 +43,21 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
 export HOME PATH
 
+# The next three lines belong into /etc/defaults/rc.conf.
+shutdown_clean_enable="NO"	# Set to YES to stop all but the first CPU
+				# core to prevent mixed buffer output
+				# upon shutdown.
+
 . /etc/rc.subr
 
 load_rc_config 'XXX'
 
+# Fall back to single core mode to guarantee clean output.
+if checkyesno shutdown_clean_enable; then
+	bitmask="$(jot -s '' -b1 $(expr $(sysctl -n hw.ncpu) - 1))0"
+	sysctl machdep.hlt_cpus=$bitmask
+fi
+
 # reverse_list list
 #	print the list in reverse order
 #


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Feb 20 21:10:59 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120914 

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: bug-followup@FreeBSD.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: conf/120914: [patch] proposed fix to rc.shutdown to turn off
 the mixed buffer messages with an rc.conf tuneable
Date: Fri, 22 Feb 2008 21:52:53 +0100

 You can reject this. It doesn't work reliably.
 
 Apparently it sometimes takes too long to move all processes off the 
 deactivated core.
 
 Sorry for the noise.
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Mon Feb 25 18:27:52 UTC 2008 
State-Changed-Why:  
Submitter requested this be closed. 


Responsible-Changed-From-To: freebsd-rc->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Mon Feb 25 18:27:52 UTC 2008 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120914 
>Unformatted:
