20 Dec, 2008

1 commit

  • Impact: fix truncated recursion bug message printout

    When recursion_bug is true, kernel discards original message because printk_buf
    contains recursion_bug_msg with NULL terminator. The sizeof(recursion_bug_msg)
    makes this, use strlen() to get correct length without NULL terminator.

    Reported-by: Toshikazu Nakayama
    Signed-off-by: Hiroshi Shimamoto
    Signed-off-by: Ingo Molnar

    Hiroshi Shimamoto
     

24 Oct, 2008

1 commit


17 Oct, 2008

3 commits

  • * 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    do_generic_file_read: s/EINTR/EIO/ if lock_page_killable() fails
    softirq, warning fix: correct a format to avoid a warning
    softirqs, debug: preemption check
    x86, pci-hotplug, calgary / rio: fix EBDA ioremap()
    IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix
    IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR sizes
    softlockup: Documentation/sysctl/kernel.txt: fix softlockup_thresh description
    dmi scan: warn about too early calls to dmi_check_system()
    generic: redefine resource_size_t as phys_addr_t
    generic: make PFN_PHYS explicitly return phys_addr_t
    generic: add phys_addr_t for holding physical addresses
    softirq: allocate less vectors
    IO resources: fix/remove printk
    printk: robustify printk, update comment
    printk: robustify printk, fix #2
    printk: robustify printk, fix
    printk: robustify printk

    Fixed up conflicts in:
    arch/powerpc/include/asm/types.h
    arch/powerpc/platforms/Kconfig.cputype
    manually.

    Linus Torvalds
     
  • Add documentation in kerneldoc for new printk format extensions

    This patch documents the new %pS/%pF options in printk in kernel doc.

    Hope I didn't miss any other extension.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • People can use the real name an an index into MAINTAINERS to find the
    current email address.

    Signed-off-by: Francois Cami
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Francois Cami
     

15 Oct, 2008

1 commit


14 Oct, 2008

1 commit


20 Aug, 2008

2 commits

  • Remove the comment describing the possibility of printk() deadlocking on
    runqueue lock.

    Signed-off-by: Jiri Kosina
    Acked-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Jiri Kosina
     
  • Dmitry Adamushko reported:

    > [*] btw., with DEBUG being enabled, pr_debug() generates [1] when
    > debug_smp_processor_id() is used (CONFIG_DEBUG_PREEMPT).
    >
    > the problem seems to be caused by the following commit:
    > commit b845b517b5e3706a3729f6ea83b88ab85f0725b0
    > Author: Peter Zijlstra
    > Date: Fri Aug 8 21:47:09 2008 +0200
    >
    > printk: robustify printk
    >
    >
    > wake_up_klogd() -> __get_cpu_var() -> smp_processor_id()
    >
    > and that's being called from release_console_sem() which is, in turn,
    > said to be "may be called from any context" [2]
    >
    > and in this case, it seems to be called from some non-preemptible
    > context (although, it can't be printk()...
    > although, I haven't looked carefully yet).
    >
    > Provided [2], __get_cpu_var() is perhaps not the right solution there.
    >
    >
    > [1]
    >
    > [ 7697.942005] BUG: using smp_processor_id() in preemptible [00000000] code: syslogd/3542
    > [ 7697.942005] caller is wake_up_klogd+0x1b/0x50
    > [ 7697.942005] Pid: 3542, comm: syslogd Not tainted 2.6.27-rc3-tip-git #2
    > [ 7697.942005] Call Trace:
    > [ 7697.942005] [] debug_smp_processor_id+0xe8/0xf0
    > [ 7697.942005] [] wake_up_klogd+0x1b/0x50
    > [ 7697.942005] [] release_console_sem+0x1e7/0x200
    > [ 7697.942005] [] do_con_write+0xb7/0x1f30
    > [ 7697.942005] [] ? show_trace+0x10/0x20
    > [ 7697.942005] [] ? dump_stack+0x72/0x80
    > [ 7697.942005] [] ? __ratelimit+0xbd/0xe0
    > [ 7697.942005] [] ? debug_smp_processor_id+0xe8/0xf0
    > [ 7697.942005] [] ? wake_up_klogd+0x1b/0x50
    > [ 7697.942005] [] ? release_console_sem+0x1e7/0x200
    > [ 7697.942005] [] con_write+0x19/0x30
    > [ 7697.942005] [] write_chan+0x276/0x3c0
    > [ 7697.942005] [] ? default_wake_function+0x0/0x10
    > [ 7697.942005] [] ? _spin_lock_irqsave+0x22/0x50
    > [ 7697.942005] [] tty_write+0x194/0x260
    > [ 7697.942005] [] ? write_chan+0x0/0x3c0
    > [ 7697.942005] [] redirected_tty_write+0xa4/0xb0
    > [ 7697.942005] [] ? redirected_tty_write+0x0/0xb0
    > [ 7697.942005] [] do_loop_readv_writev+0x52/0x80
    > [ 7697.942005] [] do_readv_writev+0x1bd/0x1d0
    > [ 7697.942005] [] vfs_writev+0x39/0x60
    > [ 7697.942005] [] sys_writev+0x50/0x90
    > [ 7697.942005] [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Peter Zijlstra
    Reported-by: Dmitry Adamushko
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

11 Aug, 2008

1 commit


31 Jul, 2008

1 commit


26 Jul, 2008

1 commit

  • All ratelimit user use same jiffies and burst params, so some messages
    (callbacks) will be lost.

    For example:
    a call printk_ratelimit(5 * HZ, 1)
    b call printk_ratelimit(5 * HZ, 1) before the 5*HZ timeout of a, then b will
    will be supressed.

    - rewrite __ratelimit, and use a ratelimit_state as parameter. Thanks for
    hints from andrew.

    - Add WARN_ON_RATELIMIT, update rcupreempt.h

    - remove __printk_ratelimit

    - use __ratelimit in net_ratelimit

    Signed-off-by: Dave Young
    Cc: "David S. Miller"
    Cc: "Paul E. McKenney"
    Cc: Dave Young
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

25 Jul, 2008

1 commit


15 Jul, 2008

1 commit


14 Jul, 2008

1 commit


12 Jul, 2008

1 commit


10 Jul, 2008

1 commit


09 Jul, 2008

1 commit


08 Jul, 2008

1 commit


18 Jun, 2008

1 commit

  • It's not explicitly marked as asmlinkage, but invoked from x86_32
    startup code with parameters on stack.

    No other architectures define early_printk and none of them are affected
    by this change, since defines asmlinkage as empty token.

    Signed-off-by: Jiri Slaby
    Cc: H. Peter Anvin
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Jiri Slaby
     

16 Jun, 2008

1 commit


27 May, 2008

1 commit

  • Without console= arguments on the kernel command line, the first
    console to register becomes enabled and the preferred console (the one
    behind /dev/console). This is normally tty (assuming
    CONFIG_VT_CONSOLE is enabled, which it commonly is).

    This is okay as long tty is a useful console. But unless we have the
    PV framebuffer, and it is enabled for this domain, tty0 in domU is
    merely a dummy. In that case, we want the preferred console to be the
    Xen console hvc0, and we want it without having to fiddle with the
    kernel command line. Commit b8c2d3dfbc117dff26058fbac316b8acfc2cb5f7
    did that for us.

    Since we now have the PV framebuffer, we want to enable and prefer tty
    again, but only when PVFB is enabled. But even then we still want to
    enable the Xen console as well.

    Problem: when tty registers, we can't yet know whether the PVFB is
    enabled. By the time we can know (xenstore is up), the console setup
    game is over.

    Solution: enable console tty by default, but keep hvc as the preferred
    console. Change the preferred console to tty when PVFB probes
    successfully, unless we've been given console kernel parameters.

    Signed-off-by: Markus Armbruster
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Thomas Gleixner

    Markus Armbruster
     

25 May, 2008

6 commits

  • printk(KERN_ALERT "Danger Will Robinson!\nAlien Approaching!\n");

    At present this will result in one message at ALERT level and one
    at the current default message loglevel (e.g. WARNING). This is
    non-intuitive.

    Modify vprintk() to remember the message loglevel each time it
    is specified and use it for subsequent lines of output which do
    not specify one, within the same call to printk.

    Signed-off-by: Nick Andrew
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Nick Andrew
     
  • Restructure the logic of vprintk() so the processing of the leading
    3 characters of each input line is in one place, regardless whether
    printk_time is enabled. This makes the code smaller and easier to
    understand.

    size reduction in kernel/printk.o:

    text data bss dec hex filename
    6157 397 1049804 1056358 101e66 printk.o.before
    6117 397 1049804 1056318 101e3e printk.o.after

    and some style uncleanlinesses removed as well as a side-effect:

    Before:
    total: 19 errors, 22 warnings, 1340 lines checked
    After:
    total: 17 errors, 22 warnings, 1333 lines checked

    Signed-off-by: Nick Andrew
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Nick Andrew
     
  • console election: If some console happens to be registered first which does
    not provide a tty binding (!console->device), it prevents that more suited
    consoles which are registered later on can enter the candidate pool for
    console_device(). This is observable with KGDB's console which may already
    be registered (and exploited!) during early debugger connections, that is
    before any regular console registration.

    This patch fixes the issue by postponing the final, automated
    preferred_console selection until someone with a non-NULL device handler
    comes around.

    Signed-off-by: Jan Kiszka
    Cc: Jason Wessel
    Cc: Gerd Hoffmann
    Cc: Michael Ellerman
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Jan Kiszka
     
  • Make printk_recursion_bug_msg static and drop printk prefix from recursion
    variables.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Tejun Heo
     
  • [ Stephen Rothwell : build fix ]

    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

24 May, 2008

1 commit

  • This patch adds latency tracing for critical timings
    (how long interrupts are disabled for).

    "irqsoff" is added to /debugfs/tracing/available_tracers

    Note:
    tracing_max_latency
    also holds the max latency for irqsoff (in usecs).
    (default to large number so one must start latency tracing)

    tracing_thresh
    threshold (in usecs) to always print out if irqs off
    is detected to be longer than stated here.
    If irq_thresh is non-zero, then max_irq_latency
    is ignored.

    Here's an example of a trace with ftrace_enabled = 0

    =======
    preemption latency trace v1.1.5 on 2.6.24-rc7
    Signed-off-by: Ingo Molnar
    --------------------------------------------------------------------
    latency: 100 us, #3/3, CPU#1 | (M:rt VP:0, KP:0, SP:0 HP:0 #P:2)
    -----------------
    | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
    -----------------
    => started at: _spin_lock_irqsave+0x2a/0xb7
    => ended at: _spin_unlock_irqrestore+0x32/0x5f

    _------=> CPU#
    / _-----=> irqs-off
    | / _----=> need-resched
    || / _---=> hardirq/softirq
    ||| / _--=> preempt-depth
    |||| /
    ||||| delay
    cmd pid ||||| time | caller
    \ / ||||| \ | /
    swapper-0 1d.s3 0us+: _spin_lock_irqsave+0x2a/0xb7 (e1000_update_stats+0x47/0x64c [e1000])
    swapper-0 1d.s3 100us : _spin_unlock_irqrestore+0x32/0x5f (e1000_update_stats+0x641/0x64c [e1000])
    swapper-0 1d.s3 100us : trace_hardirqs_on_caller+0x75/0x89 (_spin_unlock_irqrestore+0x32/0x5f)

    vim:ft=help
    =======

    And this is a trace with ftrace_enabled == 1

    =======
    preemption latency trace v1.1.5 on 2.6.24-rc7
    --------------------------------------------------------------------
    latency: 102 us, #12/12, CPU#1 | (M:rt VP:0, KP:0, SP:0 HP:0 #P:2)
    -----------------
    | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
    -----------------
    => started at: _spin_lock_irqsave+0x2a/0xb7
    => ended at: _spin_unlock_irqrestore+0x32/0x5f

    _------=> CPU#
    / _-----=> irqs-off
    | / _----=> need-resched
    || / _---=> hardirq/softirq
    ||| / _--=> preempt-depth
    |||| /
    ||||| delay
    cmd pid ||||| time | caller
    \ / ||||| \ | /
    swapper-0 1dNs3 0us+: _spin_lock_irqsave+0x2a/0xb7 (e1000_update_stats+0x47/0x64c [e1000])
    swapper-0 1dNs3 46us : e1000_read_phy_reg+0x16/0x225 [e1000] (e1000_update_stats+0x5e2/0x64c [e1000])
    swapper-0 1dNs3 46us : e1000_swfw_sync_acquire+0x10/0x99 [e1000] (e1000_read_phy_reg+0x49/0x225 [e1000])
    swapper-0 1dNs3 46us : e1000_get_hw_eeprom_semaphore+0x12/0xa6 [e1000] (e1000_swfw_sync_acquire+0x36/0x99 [e1000])
    swapper-0 1dNs3 47us : __const_udelay+0x9/0x47 (e1000_read_phy_reg+0x116/0x225 [e1000])
    swapper-0 1dNs3 47us+: __delay+0x9/0x50 (__const_udelay+0x45/0x47)
    swapper-0 1dNs3 97us : preempt_schedule+0xc/0x84 (__delay+0x4e/0x50)
    swapper-0 1dNs3 98us : e1000_swfw_sync_release+0xc/0x55 [e1000] (e1000_read_phy_reg+0x211/0x225 [e1000])
    swapper-0 1dNs3 99us+: e1000_put_hw_eeprom_semaphore+0x9/0x35 [e1000] (e1000_swfw_sync_release+0x50/0x55 [e1000])
    swapper-0 1dNs3 101us : _spin_unlock_irqrestore+0xe/0x5f (e1000_update_stats+0x641/0x64c [e1000])
    swapper-0 1dNs3 102us : _spin_unlock_irqrestore+0x32/0x5f (e1000_update_stats+0x641/0x64c [e1000])
    swapper-0 1dNs3 102us : trace_hardirqs_on_caller+0x75/0x89 (_spin_unlock_irqrestore+0x32/0x5f)

    vim:ft=help
    =======

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Steven Rostedt
     

30 Apr, 2008

3 commits

  • Fix update_console_cmdline() not to to read beyond the terminating zero of its
    name argument.

    Signed-off-by: Markus Armbruster
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Markus Armbruster
     
  • This adds a minimalistic braille screen reader support. This is meant to
    be used by blind people e.g. on boot failures or when / cannot be mounted
    etc and thus the userland screen readers can not work.

    [akpm@linux-foundation.org: fix exports]
    Signed-off-by: Samuel Thibault
    Cc: Jiri Kosina
    Cc: Dmitry Torokhov
    Acked-by: Alan Cox
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • - Operations are now a shared const function block as with most other Linux
    objects

    - Introduce wrappers for some optional functions to get consistent behaviour

    - Wrap put_char which used to be patched by the tty layer

    - Document which functions are needed/optional

    - Make put_char report success/fail

    - Cache the driver->ops pointer in the tty as tty->ops

    - Remove various surplus lock calls we no longer need

    - Remove proc_write method as noted by Alexey Dobriyan

    - Introduce some missing sanity checks where certain driver/ldisc
    combinations would oops as they didn't check needed methods were present

    [akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
    [akpm@linux-foundation.org: fix isicom]
    [akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
    [akpm@linux-foundation.org: fix kgdb]
    Signed-off-by: Alan Cox
    Acked-by: Greg Kroah-Hartman
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

29 Apr, 2008

1 commit

  • Due to the rcupreempt.h WARN_ON trigged, I got 2G syslog file. For some
    serious complaining of kernel, we need repeat the warnings, so here I isolate
    the ratelimit part of printk.c to a standalone file.

    Signed-off-by: Dave Young
    Acked-by: Paul E. McKenney
    Tested-by: Paul E. McKenney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     

16 Apr, 2008

1 commit

  • When I cleaned up printk() and split up the printk locking logic in
    commit 266c2e0abeca649fa6667a1a427ad1da507c6375 ("Make printk() console
    semaphore accesses sensible") I had incorrectly moved the call to
    have_callable_console() outside of the console semaphore.

    That was buggy. The console semaphore protects the console_drivers list
    that is used by have_callable_console().

    Thanks go to Bongani Hlope who saw this as a hang on shutdown and reboot
    and bisected the bug to the right commit, and tested this patch. See

    http://lkml.org/lkml/2008/4/11/315

    Bisected-and-tested-by: Bongani Hlope
    Cc: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 Mar, 2008

1 commit


26 Feb, 2008

1 commit

  • printk recursion detection prepends message to printk_buf and offsets
    printk_buf when actual message is printed but it forgets to trim buffer
    length accordingly. This can result in overrun in extreme cases. Fix it.

    [ mingo@elte.hu:

    bug was introduced by me via:

    commit 32a76006683f7b28ae3cc491da37716e002f198e
    Author: Ingo Molnar
    Date: Fri Jan 25 21:07:58 2008 +0100

    printk: make printk more robust by not allowing recursion
    ]

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

09 Feb, 2008

3 commits


07 Feb, 2008

1 commit

  • Stop using unsigned _longs_ for printk buffer indexes. Log buffer is way
    smaller than 2 gigabytes and unsigned ints will work too . Indeed, they do
    work nicely on all 32-bit platforms where longs and ints are the same.

    With this patch, we have following size savings on amd64:

    text data bss dec hex filename
    5997 313 17736 24046 5dee 2.6.23.1.t64/kernel/printk.o
    5858 313 17700 23871 5d3f 2.6.23.1.printk.t64/kernel/printk.o

    Signed-off-by: Denys Vlasenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denys Vlasenko