Re: printk loglevel policy?

From: Jim Nelson (james4765_at_verizon.net)
Date: 01/03/05

  • Next message: Andrey Kislyuk: "oopses and panics on 2.6.9+K8T800"
    Date:	Sun, 02 Jan 2005 23:44:03 -0500
    To: "Randy.Dunlap" <rddunlap@osdl.org>
    
    

    Randy.Dunlap wrote:
    > Keith Owens wrote:
    >
    >> On Sun, 02 Jan 2005 13:41:34 -0800, "Randy.Dunlap" <rddunlap@osdl.org>
    >> wrote:
    >>
    >>> Jim Nelson wrote:
    >>>
    >>>> Or does printk() do some tracking that I didn't see as to where in
    >>>> the kernel the strings are coming from?
    >>>
    >>>
    >>> That kind of garbled output has been known to happen, but
    >>> the <console_sem> is supposed to prevent that (along with
    >>> zap_locks() in kernel/printk.c).
    >>
    >>
    >>
    >> Using multiple calls to printk to print a single line has always been
    >> subject to the possibility of interleaving on SMP. We just live with
    >> the risk. Printing a complete line in a single call to printk is
    >> protected by various locks. Print a line in multiple calls is not
    >> protected. If it bothers you that much, build up the line in a local
    >> buffer then call printk once.
    >
    >
    > True, I was thinking about the single line case, which I
    > have seen garbled/mixed in the past (on SMP). Hopefully
    > that one is fixed.
    >

    Okay, that answered my question. Is is frowned upon to use strncat/strcat in the
    kernel? I have yet to see any use of them outside of the definition in
    lib/string.c. It would seem to be faster (less potential contention for the
    printk locks).
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Andrey Kislyuk: "oopses and panics on 2.6.9+K8T800"

    Relevant Pages

    • Re: printk loglevel policy?
      ... >>That kind of garbled output has been known to happen, ... Printing a complete line in a single call to printk is ... Print a line in multiple calls is not ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: printk loglevel policy?
      ... > subject to the possibility of interleaving on SMP. ... Printing a complete line in a single call to printk is protected by ... Print a line in multiple calls is not protected. ... The oops writer breaks the locks. ...
      (Linux-Kernel)
    • Re: printk loglevel policy?
      ... >> kernel the strings are coming from? ... Using multiple calls to printk to print a single line has always been ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC] Recursive printk
      ... multiple calls to printk so they are not interleaved. ... This is certainly needed e.g. for code which outputs line fragments ... price to pay for the benefit of recursion. ...
      (Linux-Kernel)
    • Re: [PATCH] printk: Remember the message level for multi-line output
      ... if a single call to printk() includes multiple ... contiguous output. ... way, even if the feature ends up not being applied, we'll have your nice ...
      (Linux-Kernel)