From nobody@FreeBSD.org  Thu Feb  1 10:58:17 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BB81316A401
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  1 Feb 2007 10:58:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id A9DEE13C491
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  1 Feb 2007 10:58:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l11AwHGc022109
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 1 Feb 2007 10:58:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l11AwH5G022108;
	Thu, 1 Feb 2007 10:58:17 GMT
	(envelope-from nobody)
Message-Id: <200702011058.l11AwH5G022108@www.freebsd.org>
Date: Thu, 1 Feb 2007 10:58:17 GMT
From: Arne Woerner<arne_woerner@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: messages from kernel are mixed (/dev/klog? syslog?)
X-Send-Pr-Version: www-3.0

>Number:         108655
>Category:       kern
>Synopsis:       messages from kernel are mixed (/dev/klog? syslog?)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 01 11:00:49 GMT 2007
>Closed-Date:    Fri Mar 04 15:52:14 UTC 2011
>Last-Modified:  Fri Mar 04 15:52:14 UTC 2011
>Originator:     Arne Woerner
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD neo.riddick.homeunix.org 6.2-RELEASE FreeBSD 6.2-RELEASE #2: Wed Jan 17 16:56:44 UTC 2007     aw@neo.riddick.homeunix.org:/usr/src/sys/i386/compile/NEO  i386
>Description:
When my box (UP) comes up, many kernel messages are generated.
I would guess, that they are sent to /dev/klog or so.

When I look at those messages I can see, that messages, that are
generated almost at the same time but by different kernel threads
are mixed. I would guess, that this problem becomes worse in case
of a SMP box...

It looks like this:
Feb  1 07:00:54 neo ad3: 238475MB <Seagate ST3250824ACE 3.ACH> at ata1-slave UDMA100GEOM_RAID5: Device sys created (id=4051465007, stripesize=131072).
Feb  1 07:00:54 neo GEOM_RAID5: Disk ad0s1a attached to sys.

I think, that this problem should be fixed.

-Arne
>How-To-Repeat:
Just generate many kernel messages by different threads quickly...
>Fix:
Ideas:

1.
by one buffer per "klog-ing thread" (organized as a hash map
possibly), that is flushed in case of a newline (<LF>) or so

or

2.
by preparing a kernel message in a piece of memory local to
the thread and then writing that message somehow atomically
to klog)

>Release-Note:
>Audit-Trail:

From: Yoshihiro Ota <ota@j.email.ne.jp>
To: bug-followup@FreeBSD.org
Cc: arne_woerner@yahoo.com
Subject: Re: kern/108655: messages from kernel are mixed (/dev/klog?
 syslog?)
Date: Tue, 22 Apr 2008 01:37:43 -0400

 It looks "options PRINTF_BUFR_SIZE=128" Problem.
 
 It looks similar to http://lists.freebsd.org/pipermail/freebsd-current/2008-February/083445.html, isn't it?
 
 Hiro

From: Arne "Wrner" <arne_woerner@yahoo.com>
To: Yoshihiro Ota <ota@j.email.ne.jp>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/108655: messages from kernel are mixed (/dev/klog? syslog?)
Date: Tue, 22 Apr 2008 00:11:35 -0700 (PDT)

 --- Yoshihiro Ota <ota@j.email.ne.jp> wrote:
 > It looks "options PRINTF_BUFR_SIZE=128" Problem.
 > 
 > It looks similar to
 > http://lists.freebsd.org/pipermail/freebsd-current/2008-February/083445.html,
 > isn't it?
 > 
 possibly... i cant read it completely... and i cant test it anymore... -arne
 
 
       ____________________________________________________________________________________
 Be a better friend, newshound, and 
 know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Fri Mar 4 15:51:44 UTC 2011 
State-Changed-Why:  
PRINTF_BUFR_SIZE is set to 128 in GENERIC config now. Submitter can't 
test anymore. 

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