From owner-freebsd-hackers Tue Jan 22 19:14:55 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from gadolinium.btinternet.com (gadolinium.btinternet.com [194.73.73.111]) by hub.freebsd.org (Postfix) with ESMTP id 8636437B404 for ; Tue, 22 Jan 2002 19:14:47 -0800 (PST) Received: from host217-36-21-130.in-addr.btopenworld.com ([217.36.21.130] helo=jrochester.org) by gadolinium.btinternet.com with esmtp (Exim 3.22 #8) id 16TDrt-0001QO-00; Wed, 23 Jan 2002 03:14:33 +0000 Message-ID: <3C4E2AC6.9060700@jrochester.org> Date: Wed, 23 Jan 2002 03:15:18 +0000 From: John Rochester User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.7) Gecko/20020109 X-Accept-Language: en-us MIME-Version: 1.0 To: Greg Black Cc: hackers@FreeBSD.ORG Subject: Re: cpu info in userland References: <20020122113351.A25927@Odin.AC.HMC.Edu> <20020122155202.J2872@numachi.com> <3C4DD39B.2050906@rambo.simx.org> <20020122161406.L2872@numachi.com> <20020122175631.A83184@blossom.cjclark.org> Content-Type: multipart/mixed; boundary="------------040102030403080900050609" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------040102030403080900050609 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Greg Black wrote: > "Crist J . Clark" wrote: > > | On Wed, Jan 23, 2002 at 11:41:24AM +1000, Greg Black wrote: > | > Brian Reichert wrote: > | > > | > | I've seen situations where 'dmesg' (and by extension dmesg.boot) > | > | will contain multiple passes of device probes, etc. I could easily > | > | be imagining this, as I can't think of a mechanism to allow for > | > | it, nor a reason to do it... > | > > | > You're not imagining it -- certainly 4.4-RELEASE does this. > | > | If you drop to single-user and go back to multi-user, dmesg.boot gets > | written again in rc(8). I have patched rc(8) to only write dmesg.boot > | at boot. I should look again at committing that. > > I have never dropped to single-user. But my 4.4-RELEASE laptop > has the records of several full reboots in /var/run/dmesg.boot, > which I really wish it wouldn't ... A simple hack to handle this would be to place the untested attached nodmesg.sh into /usr/local/etc/rc.d and make it executable. This should clear the kernel's message buffer on shutdown. Alternatively you could patch your kernel to disable the attempt to save the message buffer on boot. The function msgbufinit in src/sys/kern/subr_prf.c is the culprit. I would supply a patch but the check has changed since 4.4-RELEASE (it would sometimes fail to detect a corrupt message buffer). Interestingly it appears that only laptops manage to keep the buffer contents between boots - must be something about the memory architecture or BIOS. -- John Rochester Software Architect, Merus Software Ltd. Tel: +44 7870 174690 http://merus.co.uk --------------040102030403080900050609 Content-Type: text/plain; name="nodmesg.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nodmesg.sh" #!/bin/sh case $1 in stop) sysctl -w kern.msgbuf_clear=1 > /dev/null esac --------------040102030403080900050609-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message