Fix für Konsolenoutput beim Shutdown auf SMP-Systemen

Kamikaze

Warrior of Sunlight
Staff member
Einfach Patch anwenden, und in die rc.conf folgendes eintragen:
Code:
shutdown_clean_enable="YES"
Code:
--- 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
 #

Wer das für eine gute Idee hält, kann beim PR seinen Senf dazu abgeben.
 
Hab ich dich auf die Idee gebracht, als ich vorhin das Sysctl hier erwähnt hatte? ;)
 
Ja, natürlich. Es hat ein paar Versuche gebraucht, bis das System nicht eingefroren ist. Es ist anscheinend wichtig, dass es der erste Core ist, der am Laufen bleibt.
 
Aber der shutdown könnte dadurch länger dauern. Es werden ja schließlich alle bis auf einen CPU-Kern abgeschaltet.

Man könnte den default auf YES setzen, aber es sollte abschaltbar bleiben.
 
Ja, aber dafür muss man den Kernel neu bauen. Meins kann man nach Belieben an- und abschalten.
 
Das kann doch beides keine Lösung sein. Da muss doch irgendwas her, dass das Problem an der Wurzel packt und das out of the box funktioniert.
 
Das kann doch beides keine Lösung sein. Da muss doch irgendwas her, dass das Problem an der Wurzel packt und das out of the box funktioniert.
Ich habe zwei Kerne und bevor die Puffer synchronisiert werden wird der eine abgeschaltet. Hab noch nie irgendwelche kryptische Ausgaben gehabt.
Insofern denke ich mal, dass wenn ihr sowas habt, dass ein Bug ist.
 
Last edited:
Das ist kein Bug, wie inzwischen ca. 50 Mal auf freebsd-current@ und freebsd-stable@ festgestellt wurde:
> I'm hoping to update all our servers to 7 in the near future.
> As such, I'm experimenting with it on one of our less prominent
> production servers.
> My procedure for it's installation and usage:
>
> download 7-CURRENT disk1 iso (B4) from nearest freebsd mirror
> install choice - minimum + src
> make config options, reboot
> download cvsup-no-gui pkg
> cvsup ports + src
> (above procedures performed 2007-12-30)
> (above procedures again performed on 2007-12-31)
> In every case, I wiped the hard drive, performing a fresh install.
>
> After initial install. Sending a halt, in order to reboot the system
> results in garbled messages to the console. Specifically, the
> Syncing disks... message is unintelligible. As does is line
> preceding it.

[ .. ]

It is just a sign that 7 is getting higher concurrency than 6 did.

[ .. ]
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2008-01/msg00024.html

Wenn euch das stört, könnte ihr die PRINTF_BURF_SIZE Option in den Kernel backen. Diese verfügt allerdings noch nicht über einen Überlaufschutz, was durchaus gefährlich sein kann. Wollt ihr mehr, müsst ihr warten bis jemand ein neues Kernel-Printf geschrieben hat oder es selbst in ANgriff nehmen :)
 
Soso, wenn es kein Bug ist, warum schickt Kamikaze dann einen PR mit Fix? Und Zeichensalat im Konsolenoutput ist jetzt neues Qualitätsmerkmal?
 
Es ist kein Bug, weil das ganze ein Querschläger der höheren Parallelisierung ist. Ein Bug ist imo etwas, was kaputt ist und hier ist nichts kaputt. Einigen wir uns darauf, dass die ganze Sache unschön ist :)
 
Back
Top