25 Apr, 2012

1 commit

  • Send an NMI to all CPUs when a hung task is detected and the hung
    task code is configured to panic. This gives us a fairly uptodate
    snapshot of all CPUs in the system.

    This lets us get stack trace of all CPUs which makes life easier
    trying to debug a deadlock, and the NMI doesn't change anything
    since the next step is a kernel panic.

    Signed-off-by: Sasha Levin
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Link: http://lkml.kernel.org/r/1331848040-1676-1-git-send-email-levinsasha928@gmail.com
    [ extended the changelog a bit ]
    Signed-off-by: Ingo Molnar

    Sasha Levin
     

06 Mar, 2012

1 commit

  • check_hung_uninterruptible_tasks()->rcu_lock_break() introduced by
    "softlockup: check all tasks in hung_task" commit ce9dbe24 looks
    absolutely wrong.

    - rcu_lock_break() does put_task_struct(). If the task has exited
    it is not safe to even read its ->state, nothing protects this
    task_struct.

    - The TASK_DEAD checks are wrong too. Contrary to the comment, we
    can't use it to check if the task was unhashed. It can be unhashed
    without TASK_DEAD, or it can be valid with TASK_DEAD.

    For example, an autoreaping task can do release_task(current)
    long before it sets TASK_DEAD in do_exit().

    Or, a zombie task can have ->state == TASK_DEAD but release_task()
    was not called, and in this case we must not break the loop.

    Change this code to check pid_alive() instead, and do this before we drop
    the reference to the task_struct.

    Note: while_each_thread() under rcu_read_lock() is not really safe, it can
    livelock. This will be fixed later, but fortunately in this case the
    "max_count" logic saves us anyway.

    Signed-off-by: Oleg Nesterov
    Acked-by: Frederic Weisbecker
    Acked-by: Mandeep Singh Baines
    Acked-by: Paul E. McKenney
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

04 Jan, 2012

1 commit

  • vfork parent uninterruptibly and unkillably waits for its child to
    exec/exit. This wait is of unbounded length. Ignore such waits
    in the hung_task detector.

    Signed-off-by: Mandeep Singh Baines
    Reported-by: Sasha Levin
    LKML-Reference:
    Cc: Linus Torvalds
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Andrew Morton
    Cc: John Kacur
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds

    Mandeep Singh Baines
     

31 Oct, 2011

1 commit

  • The changed files were only including linux/module.h for the
    EXPORT_SYMBOL infrastructure, and nothing else. Revector them
    onto the isolated export header for faster compile times.

    Nothing to see here but a whole lot of instances of:

    -#include
    +#include

    This commit is only changing the kernel dir; next targets
    will probably be mm, fs, the arch dirs, etc.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

28 Apr, 2011

1 commit

  • This patch allows the default value for sysctl_hung_task_timeout_secs
    to be set at build time. The feature carries virtually no overhead,
    so it makes sense to keep it enabled. On heavily loaded systems, though,
    it can end up triggering stack traces when there is no bug other than
    the system being underprovisioned. We use this patch to keep the hung task
    facility available but disabled at boot-time.

    The default of 120 seconds is preserved. As a note, commit e162b39a may
    have accidentally reverted commit fb822db4, which raised the default from
    120 seconds to 480 seconds.

    Signed-off-by: Jeff Mahoney
    Acked-by: Mandeep Singh Baines
    Link: http://lkml.kernel.org/r/4DB8600C.8080000@suse.com
    Signed-off-by: Ingo Molnar

    Jeff Mahoney
     

17 Aug, 2010

2 commits


27 Nov, 2009

1 commit

  • I'm seeing spikes of up to 0.5ms in khungtaskd on a large
    machine. To reduce this source of jitter I tried setting
    hung_task_check_count to 0:

    # echo 0 > /proc/sys/kernel/hung_task_check_count

    which didn't have the intended response. Change to a post
    increment of max_count, so a value of 0 means check 0 tasks.

    Signed-off-by: Anton Blanchard
    Acked-by: Frederic Weisbecker
    Cc: msb@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Anton Blanchard
     

24 Sep, 2009

1 commit

  • It's unused.

    It isn't needed -- read or write flag is already passed and sysctl
    shouldn't care about the rest.

    It _was_ used in two places at arch/frv for some reason.

    Signed-off-by: Alexey Dobriyan
    Cc: David Howells
    Cc: "Eric W. Biederman"
    Cc: Al Viro
    Cc: Ralf Baechle
    Cc: Martin Schwidefsky
    Cc: Ingo Molnar
    Cc: "David S. Miller"
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

11 Feb, 2009

1 commit

  • When we check if a task has been switched out since the last scan, we might
    have a race condition on the following scenario:

    - the task is freshly created and scheduled

    - it puts its state to TASK_UNINTERRUPTIBLE and is not yet switched out

    - check_hung_task() scans this task and will report a false positive because
    t->nvcsw + t->nivcsw == t->last_switch_count == 0

    Add a check for such cases.

    Signed-off-by: Frederic Weisbecker
    Acked-by: Mandeep Singh Baines
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

09 Feb, 2009

1 commit


06 Feb, 2009

2 commits

  • Since the tasklist is protected by rcu list operations, it is safe
    to convert the read_lock()s to rcu_read_lock().

    Suggested-by: Peter Zijlstra
    Signed-off-by: Mandeep Singh Baines
    Signed-off-by: Ingo Molnar

    Mandeep Singh Baines
     
  • Impact: extend the scope of hung-task checks

    Changed the default value of hung_task_check_count to PID_MAX_LIMIT.
    hung_task_batch_count added to put an upper bound on the critical
    section. Every hung_task_batch_count checks, the rcu lock is never
    held for a too long time.

    Keeping the critical section small minimizes time preemption is disabled
    and keeps rcu grace periods small.

    To prevent following a stale pointer, get_task_struct is called on g and t.
    To verify that g and t have not been unhashed while outside the critical
    section, the task states are checked.

    The design was proposed by Frédéric Weisbecker.

    Signed-off-by: Mandeep Singh Baines
    Suggested-by: Frédéric Weisbecker
    Acked-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Mandeep Singh Baines
     

19 Jan, 2009

1 commit


16 Jan, 2009

1 commit

  • Decoupling allows:

    * hung tasks check to happen at very low priority

    * hung tasks check and softlockup to be enabled/disabled independently
    at compile and/or run-time

    * individual panic settings to be enabled disabled independently
    at compile and/or run-time

    * softlockup threshold to be reduced without increasing hung tasks
    poll frequency (hung task check is expensive relative to softlock watchdog)

    * hung task check to be zero over-head when disabled at run-time

    Signed-off-by: Mandeep Singh Baines
    Signed-off-by: Ingo Molnar

    Mandeep Singh Baines