1. 13 2月, 2008 2 次提交
    • P
      sched: fair-group: separate tg->shares from task_group_lock · 8ed36996
      Peter Zijlstra 提交于
      On Mon, 2008-02-11 at 15:09 +0300, Denis V. Lunev wrote:
      > BUG: sleeping function called from invalid context
      > at /home/den/src/linux-netns26/kernel/mutex.c:209
      > in_atomic():1, irqs_disabled():0
      > no locks held by swapper/0.
      > Pid: 0, comm: swapper Not tainted 2.6.24 #304
      >
      > Call Trace:
      >  <IRQ>  [<ffffffff80252d1e>] ? __debug_show_held_locks+0x15/0x27
      >  [<ffffffff8022c2a8>] __might_sleep+0xc0/0xdf
      >  [<ffffffff8049f1df>] mutex_lock_nested+0x28/0x2a9
      >  [<ffffffff80231294>] sched_destroy_group+0x18/0xea
      >  [<ffffffff8023e835>] sched_destroy_user+0xd/0xf
      >  [<ffffffff8023e8c1>] free_uid+0x8a/0xab
      >  [<ffffffff80233e24>] __put_task_struct+0x3f/0xd3
      >  [<ffffffff80236708>] delayed_put_task_struct+0x23/0x25
      >  [<ffffffff8026fda7>] __rcu_process_callbacks+0x8d/0x215
      >  [<ffffffff8026ff52>] rcu_process_callbacks+0x23/0x44
      >  [<ffffffff8023a2ae>] __do_softirq+0x79/0xf8
      >  [<ffffffff8020f8c3>] ? profile_pc+0x2a/0x67
      >  [<ffffffff8020d38c>] call_softirq+0x1c/0x30
      >  [<ffffffff8020f689>] do_softirq+0x61/0x9c
      >  [<ffffffff8023a233>] irq_exit+0x51/0x53
      >  [<ffffffff8021bd1a>] smp_apic_timer_interrupt+0x77/0xad
      >  [<ffffffff8020ce3b>] apic_timer_interrupt+0x6b/0x70
      >  <EOI>  [<ffffffff8020b0dd>] ? default_idle+0x43/0x76
      >  [<ffffffff8020b0db>] ? default_idle+0x41/0x76
      >  [<ffffffff8020b09a>] ? default_idle+0x0/0x76
      >  [<ffffffff8020b186>] ? cpu_idle+0x76/0x98
      
      separate the tg->shares protection from the task_group lock.
      Reported-by: NDenis V. Lunev <den@openvz.org>
      Tested-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8ed36996
    • P
      hrtimer: more hrtimer_init_sleeper() fallout. · 720a2592
      Peter Zijlstra 提交于
      Missed an instance...
      
        futex_lock_pi()
          hrtimer_init_sleeper()
          rt_mutex_timed_lock()
            rt_mutex_timed_fastlock()
              rt_mutex_slowlock()
                hrtimer_start()
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      720a2592
  2. 10 2月, 2008 5 次提交
    • O
      hrtimer: don't modify restart_block->fn in restart functions · c289b074
      Oleg Nesterov 提交于
      hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is
      pointless and complicates its usage. Note that if sys_restart_syscall()
      doesn't actually happen, we have a bogus "pending" restart->fn anyway,
      this is harmless.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Alexey Dobriyan <adobriyan@sw.ru>
      Cc: Pavel Emelyanov <xemul@sw.ru>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Toyo Abe <toyoa@mvista.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      c289b074
    • O
      hrtimer: fix *rmtp/restarts handling in compat_sys_nanosleep() · 41652937
      Oleg Nesterov 提交于
      Spotted by Pavel Emelyanov and Alexey Dobriyan.
      
      compat_sys_nanosleep() implicitly uses hrtimer_nanosleep_restart(), this can't
      work. Make a suitable compat_nanosleep_restart() helper.
      
      Introduced by commit c70878b4
      hrtimer: hook compat_sys_nanosleep up to high res timer code
      
      Also, set ->addr_limit = KERNEL_DS before doing hrtimer_nanosleep(), this func
      was changed by the previous patch and now takes the "__user *" parameter.
      
      Thanks to Ingo Molnar for fixing the bug in this patch.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alexey Dobriyan <adobriyan@sw.ru>
      Cc: Pavel Emelyanov <xemul@sw.ru>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Toyo Abe <toyoa@mvista.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      41652937
    • O
      hrtimer: fix *rmtp handling in hrtimer_nanosleep() · 080344b9
      Oleg Nesterov 提交于
      Spotted by Pavel Emelyanov and Alexey Dobriyan.
      
      hrtimer_nanosleep() sets restart_block->arg1 = rmtp, but this rmtp points to
      the local variable which lives in the caller's stack frame. This means that
      if sys_restart_syscall() actually happens and it is interrupted as well, we
      don't update the user-space variable, but write into the already dead stack
      frame.
      
      Introduced by commit 04c22714
      hrtimer: Rework hrtimer_nanosleep to make sys_compat_nanosleep easier
      
      Change the callers to pass "__user *rmtp" to hrtimer_nanosleep(), and change
      hrtimer_nanosleep() to use copy_to_user() to actually update *rmtp.
      
      Small problem remains. man 2 nanosleep states that *rtmp should be written if
      nanosleep() was interrupted (it says nothing whether it is OK to update *rmtp
      if nanosleep returns 0), but (with or without this patch) we can dirty *rem
      even if nanosleep() returns 0.
      
      NOTE: this patch doesn't change compat_sys_nanosleep(), because it has other
      bugs. Fixed by the next patch.
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Alexey Dobriyan <adobriyan@sw.ru>
      Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
      Cc: Pavel Emelyanov <xemul@sw.ru>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Toyo Abe <toyoa@mvista.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      
       include/linux/hrtimer.h |    2 -
       kernel/hrtimer.c        |   51 +++++++++++++++++++++++++-----------------------
       kernel/posix-timers.c   |   14 +------------
       3 files changed, 30 insertions(+), 37 deletions(-)
      080344b9
    • J
      ntp: correct inconsistent interval/tick_length usage · e13a2e61
      john stultz 提交于
      clocksource initialization and error accumulation.  This corrects a 280ppm
      drift seen on some systems using acpi_pm, and affects other clocksources as
      well (likely to a lesser degree).
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      e13a2e61
    • S
  3. 09 2月, 2008 33 次提交