misc/120914: [patch] proposed fix to rc.shutdown to turn off the
mixed buffer messages with an rc.conf tuneable
Dominic Fandrey
kamikaze at bsdforen.de
Wed Feb 20 19:30:03 UTC 2008
>Number: 120914
>Category: misc
>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: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Feb 20 19:30:02 UTC 2008
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:
More information about the freebsd-bugs
mailing list