lkml.org 
[lkml]   [2012]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RESEND 1/3] printk: convert byte-buffer to variable-length record buffer
From
Date
On Thu, May 10, 2012 at 10:52 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:

> The change to verify that 'current' matches the previous printout is
> so far the *only* sane semantic change I've seen in this thread.
> Everything else has been pure garbage.

Ok, let's continue with sane things then. :)

Here is a stupid kernel module which creates 3 racy printk() loops, 2 of
them do continuation, one does an atomic print. The continuation one
prints one char per printk.
http://people.freedesktop.org/~kay/printk-race/printk-race.c

The lines all try to look like:
(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
(CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC)
(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
Every loop has it's own uppercase character. The line enclosed in '()'.
'A' is the atomic one, the cont ones are 'C' and 'X'.

Our current kernel look like:
[ 99.056806] XC(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 99.059772] XC(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 99.062168] XCCX(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 99.066479] CXXC(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 99.070063] XC(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 99.073081] XCCXCXCXCXCXCXCXCXCXCXCXCXCXCXCCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXC)
[ 99.148325] (CCXCXCX)
[ 99.155468] (XXCXCXCXCCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXCXXCXCXCXCXCXCXCXCXC)
[ 99.277357] (CCXCXCXCX)
http://people.freedesktop.org/~kay/printk-race/printk-out-before.txt

The kernel with the record buffer, and the 'current' who owns the cont buffer
looks like:
[ 78.080866] (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 78.082790] (CC
[ 78.084152] (XX
[ 78.084497] (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 78.085494] C
[ 78.086125] X
[ 78.087188] C
[ 78.088669] X
[ 78.089803] C
[ 78.091510] X
[ 78.091924] (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)
[ 78.094112] CC
[ 78.096171] X
http://people.freedesktop.org/~kay/printk-race/printk-out-after.txt
Thanks,
Kay



\
 
 \ /
  Last update: 2012-05-11 03:01    [W:0.190 / U:0.296 seconds]
©2003-2014 Jasper Spaans. Advertise on this site