1. 05 8月, 2008 1 次提交
  2. 19 7月, 2008 1 次提交
    • T
      nohz: prevent tick stop outside of the idle loop · b8f8c3cf
      Thomas Gleixner 提交于
      Jack Ren and Eric Miao tracked down the following long standing
      problem in the NOHZ code:
      
      	scheduler switch to idle task
      	enable interrupts
      
      Window starts here
      
      	----> interrupt happens (does not set NEED_RESCHED)
      	      	irq_exit() stops the tick
      
      	----> interrupt happens (does set NEED_RESCHED)
      
      	return from schedule()
      	
      	cpu_idle(): preempt_disable();
      
      Window ends here
      
      The interrupts can happen at any point inside the race window. The
      first interrupt stops the tick, the second one causes the scheduler to
      rerun and switch away from idle again and we end up with the tick
      disabled.
      
      The fact that it needs two interrupts where the first one does not set
      NEED_RESCHED and the second one does made the bug obscure and extremly
      hard to reproduce and analyse. Kudos to Jack and Eric.
      
      Solution: Limit the NOHZ functionality to the idle loop to make sure
      that we can not run into such a situation ever again.
      
      cpu_idle()
      {
      	preempt_disable();
      
      	while(1) {
      		 tick_nohz_stop_sched_tick(1); <- tell NOHZ code that we
      		 			          are in the idle loop
      
      		 while (!need_resched())
      		       halt();
      
      		 tick_nohz_restart_sched_tick(); <- disables NOHZ mode
      		 preempt_enable_no_resched();
      		 schedule();
      		 preempt_disable();
      	}
      }
      
      In hindsight we should have done this forever, but ... 
      
      /me grabs a large brown paperbag.
      
      Debugged-by: Jack Ren <jack.ren@marvell.com>, 
      Debugged-by: Neric miao <eric.y.miao@gmail.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b8f8c3cf
  3. 20 4月, 2008 2 次提交
  4. 27 2月, 2008 1 次提交
    • H
      avr32: Fix OCD refcounting bug · 325d6f55
      Haavard Skinnemoen 提交于
      Iff the parent has TIF_DEBUG set, _and_ clone_flags includes
      CLONE_PTRACE we should set the TIF_DEBUG flag for the child and
      increment the ocd refcount. Otherwise, the TIF_DEBUG flag must be
      unset.
      
      Currently, the child inherits TIF_DEBUG from the parent before
      copy_thread is called, so TIF_DEBUG may be already be set before we
      determine whether the child is supposed to inherit debugging
      capabilities from the parent or not. This means that ocd_enable()
      won't increment the refcount, because TIF_DEBUG is already set, and
      that TIF_DEBUG will be set for processes that aren't being debugged.
      
      This leads to a refcounting asymmetry, which may show up as
      
      ------------[ cut here ]------------
      Badness at arch/avr32/kernel/ocd.c:73
      PC is at ocd_disable+0x34/0x60
      LR is at put_lock_stats+0xa/0x20
      
      as reported by David Brownell. Happens when strace'ing a process that
      forks a new child process, e.g. "strace mount -tjffs2 mtd1 /mnt", and
      subsequently killing the child process (e.g. "umount /mnt".)
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      325d6f55
  5. 15 2月, 2008 1 次提交
  6. 25 1月, 2008 1 次提交
    • H
      [AVR32] Enable debugging only when needed · 13b54a50
      Haavard Skinnemoen 提交于
      Keep track of processes being debugged (including the kernel itself)
      and turn the OCD system on and off as appropriate. Since enabling
      debugging turns off some optimizations in the CPU core, this fixes the
      issue that enabling KProbes support or simply running a program under
      gdbserver will reduce system performance significantly until the next
      reboot.
      
      The CPU performance will still be reduced for all processes while a
      process is being debugged, but this is a lot better than reducing the
      performance forever.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      13b54a50
  7. 07 12月, 2007 2 次提交
    • H
      [AVR32] Clean up OCD register usage · 8dfe8f29
      Haavard Skinnemoen 提交于
      Generate a new set of OCD register definitions in asm/ocd.h and rename
      __mfdr() and __mtdr() to ocd_read() and ocd_write() respectively.
      
      The bitfield definitions are a lot more complete now, and they are
      entirely based on bit numbers, not masks. This is because OCD
      registers are frequently accessed from assembly code, where bit
      numbers are a lot more useful (can be fed directly to sbr, bfins,
      etc.)
      
      Bitfields that consist of more than one bit have two definitions:
      _START, which indicates the number of the first bit, and _SIZE, which
      indicates the number of bits. These directly correspond to the
      parameters taken by the bfextu, bfexts and bfins instructions.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      8dfe8f29
    • H
      [AVR32] Fix invalid status register bit definitions in asm/ptrace.h · df679771
      Haavard Skinnemoen 提交于
      The 'H' bit is bit 29, while the 'R' bit doesn't exist. Luckily, we
      don't actually use any of the bits in question.
      
      Also update show_regs() to show the Debug Mask and Debug state bits.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      df679771
  8. 10 5月, 2007 1 次提交
  9. 27 4月, 2007 2 次提交
  10. 08 12月, 2006 1 次提交
  11. 26 9月, 2006 1 次提交