1. 14 Dec, 2009 3 commits
    • Thomas Gleixner's avatar
      sched: Use rcu in sched_get_rr_param() · 1a551ae7
      Thomas Gleixner authored
      read_lock(&tasklist_lock) does not protect
      sys_sched_get_rr_param() against a concurrent update of the
      policy or scheduler parameters as do_sched_scheduler() does not
      take the tasklist_lock.
      
      The access to task->sched_class->get_rr_interval is protected by
      task_rq_lock(task).
      
      Use rcu_read_lock() to protect find_task_by_vpid() and prevent
      the task struct from going away.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20091209100706.862897167@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1a551ae7
    • Thomas Gleixner's avatar
      sched: Use rcu in sched_get/set_affinity() · 23f5d142
      Thomas Gleixner authored
      tasklist_lock is held read locked to protect the
      find_task_by_vpid() call and to prevent the task going away.
      sched_setaffinity acquires a task struct ref and drops tasklist
      lock right away. The access to the cpus_allowed mask is
      protected by rq->lock.
      
      rcu_read_lock() provides the same protection here.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20091209100706.789059966@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      23f5d142
    • Thomas Gleixner's avatar
      sched: Use rcu in sys_sched_getscheduler/sys_sched_getparam() · 5fe85be0
      Thomas Gleixner authored
      read_lock(&tasklist_lock) does not protect
      sys_sched_getscheduler and sys_sched_getparam() against a
      concurrent update of the policy or scheduler parameters as
      do_sched_setscheduler() does not take the tasklist_lock. The
      accessed integers can be retrieved w/o locking and are snapshots
      anyway.
      
      Using rcu_read_lock() to protect find_task_by_vpid() and prevent
      the task struct from going away is not changing the above
      situation.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20091209100706.753790977@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5fe85be0
  2. 13 Dec, 2009 2 commits
    • Joe Perches's avatar
      sched: Use pr_fmt() and pr_<level>() · 663997d4
      Joe Perches authored
      - Convert printk(KERN_<level> to pr_<level> (not KERN_DEBUG)
       - Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
       - Coalesce long format strings
       - Add missing \n to "ERROR: !SD_LOAD_BALANCE domain has parent"
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1260655047.2637.7.camel@Joe-Laptop.home>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      663997d4
    • Rafael J. Wysocki's avatar
      sched: Make wakeup side and atomic variants of completion API irq safe · 7539a3b3
      Rafael J. Wysocki authored
      Alan Stern noticed that all the wakeup side (and atomic) variants of the
      completion APIs should be irq safe, but the newly introduced
      completion_done() and try_wait_for_completion() aren't. The use of the
      irq unsafe variants in IRQ contexts can cause crashes/hangs.
      
      Fix the problem by making them use spin_lock_irqsave() and
      spin_lock_irqrestore().
      Reported-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: pm list <linux-pm@lists.linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: David Chinner <david@fromorbit.com>
      Cc: Lachlan McIlroy <lachlan@sgi.com>
      LKML-Reference: <200912130007.30541.rjw@sisk.pl>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7539a3b3
  3. 12 Dec, 2009 35 commits