1. 23 2月, 2009 1 次提交
    • S
      powerpc64: port of the function graph tracer · 6794c782
      Steven Rostedt 提交于
      This is a port of the function graph tracer that was written by
      Frederic Weisbecker for the x86.
      
      This only works for PPC64 at the moment and only for static tracing.
      PPC32 and dynamic function graph tracing support will come later.
      
      The trace produces a visual calling of functions:
      
       # tracer: function_graph
       #
       # CPU  DURATION                  FUNCTION CALLS
       # |     |   |                     |   |   |   |
        0)   2.224 us    |                        }
        0) ! 271.024 us  |                      }
        0) ! 320.080 us  |                    }
        0) ! 324.656 us  |                  }
        0) ! 329.136 us  |                }
        0)               |                .put_prev_task_fair() {
        0)               |                  .update_curr() {
        0)   2.240 us    |                    .update_min_vruntime();
        0)   6.512 us    |                  }
        0)   2.528 us    |                  .__enqueue_entity();
        0) + 15.536 us   |                }
        0)               |                .pick_next_task_fair() {
        0)   2.032 us    |                  .__pick_next_entity();
        0)   2.064 us    |                  .__clear_buddies();
        0)               |                  .set_next_entity() {
        0)   2.672 us    |                    .__dequeue_entity();
        0)   6.864 us    |                  }
      
      Geoff Lavand tested on PS3.
      Tested-by: NGeoff Levand <geoffrey.levand@am.sony.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6794c782
  2. 31 12月, 2008 1 次提交
    • M
      [PATCH] idle cputime accounting · 79741dd3
      Martin Schwidefsky 提交于
      The cpu time spent by the idle process actually doing something is
      currently accounted as idle time. This is plain wrong, the architectures
      that support VIRT_CPU_ACCOUNTING=y can do better: distinguish between the
      time spent doing nothing and the time spent by idle doing work. The first
      is accounted with account_idle_time and the second with account_system_time.
      The architectures that use the account_xxx_time interface directly and not
      the account_xxx_ticks interface now need to do the check for the idle
      process in their arch code. In particular to improve the system vs true
      idle time accounting the arch code needs to measure the true idle time
      instead of just testing for the idle process.
      To improve the tick based accounting as well we would need an architecture
      primitive that can tell us if the pt_regs of the interrupted context
      points to the magic instruction that halts the cpu.
      
      In addition idle time is no more added to the stime of the idle process.
      This field now contains the system time of the idle process as it should
      be. On systems without VIRT_CPU_ACCOUNTING this will always be zero as
      every tick that occurs while idle is running will be accounted as idle
      time.
      
      This patch contains the necessary common code changes to be able to
      distinguish idle system time and true idle time. The architectures with
      support for VIRT_CPU_ACCOUNTING need some changes to exploit this.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      79741dd3
  3. 03 12月, 2008 2 次提交
  4. 04 8月, 2008 1 次提交
  5. 28 7月, 2008 1 次提交
  6. 26 7月, 2008 1 次提交
  7. 25 7月, 2008 1 次提交
  8. 15 7月, 2008 1 次提交
  9. 09 7月, 2008 1 次提交
  10. 03 7月, 2008 1 次提交
  11. 01 7月, 2008 3 次提交
  12. 29 4月, 2008 1 次提交
    • K
      [POWERPC] Add IRQSTACKS support on ppc32 · 85218827
      Kumar Gala 提交于
      This makes it possible to use separate stacks for hard and soft IRQs
      on 32-bit powerpc as well as on 64-bit.  The code for 32-bit is just
      the 32-bit analog of the 64-bit code.
      
      * Added allocation and initialization of the irq stacks.  We limit the
        stacks to be in lowmem for ppc32.
      * Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
        to switch the stack pointers
      * Reworked how we do stack overflow detection.  We now keep around the
        limit of the stack in the thread_struct and compare against the limit
        to see if we've overflowed.  We can now use this on ppc64 if desired.
      
      [ paulus@samba.org: Fixed bug on 6xx where we need to reload r9 with the
        thread_info pointer. ]
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      85218827
  13. 24 4月, 2008 1 次提交
  14. 18 4月, 2008 1 次提交
  15. 28 3月, 2008 1 次提交
    • M
      [POWERPC] Fix missed hardware breakpoints across multiple threads · a2ceff5e
      Michael Ellerman 提交于
      There is a bug in the powerpc DABR (data access breakpoint) handling,
      which can result in us missing breakpoints if several threads are trying
      to break on the same address.
      
      The circumstances are that do_page_fault() calls do_dabr(), this clears
      the DABR (sets it to 0) and sets up the signal which will report to
      userspace that the DABR was hit. The do_signal() code will restore the DABR
      value on the way out to userspace.
      
      If we reschedule before calling do_signal(), __switch_to() will check the
      cached DABR value and compare it to the new thread's value, if they match
      we don't set the DABR in hardware.
      
      So if two threads have the same DABR value, and we schedule from one to
      the other after taking the interrupt for the first thread hitting the DABR,
      the second thread will run without the DABR set in hardware.
      
      The cleanest fix is to move the cache update into set_dabr(), that way we
      can't forget to do it.
      Reported-by: NJan Kratochvil <jan.kratochvil@redhat.com>
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a2ceff5e
  16. 26 3月, 2008 1 次提交
  17. 20 3月, 2008 1 次提交
  18. 14 2月, 2008 1 次提交
  19. 06 12月, 2007 1 次提交
    • T
      [POWERPC] Fix hardware IRQ time accounting problem. · 81a3843f
      Tony Breeds 提交于
      The commit fa13a5a1 (sched: restore
      deterministic CPU accounting on powerpc), unconditionally calls
      update_process_tick() in system context.  In the deterministic
      accounting case this is the correct thing to do.  However, in the
      non-deterministic accounting case we need to not do this, since doing
      this results in the time accounted as hardware irq time being
      artificially elevated.
      
      Also this collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
      checks in time.h into one for neatness.
      Signed-off-by: NTony Breeds <tony@bakeyournoodle.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      81a3843f
  20. 10 11月, 2007 1 次提交
    • P
      sched: restore deterministic CPU accounting on powerpc · fa13a5a1
      Paul Mackerras 提交于
      Since powerpc started using CONFIG_GENERIC_CLOCKEVENTS, the
      deterministic CPU accounting (CONFIG_VIRT_CPU_ACCOUNTING) has been
      broken on powerpc, because we end up counting user time twice: once in
      timer_interrupt() and once in update_process_times().
      
      This fixes the problem by pulling the code in update_process_times
      that updates utime and stime into a separate function called
      account_process_tick.  If CONFIG_VIRT_CPU_ACCOUNTING is not defined,
      there is a version of account_process_tick in kernel/timer.c that
      simply accounts a whole tick to either utime or stime as before.  If
      CONFIG_VIRT_CPU_ACCOUNTING is defined, then arch code gets to
      implement account_process_tick.
      
      This also lets us simplify the s390 code a bit; it means that the s390
      timer interrupt can now call update_process_times even when
      CONFIG_VIRT_CPU_ACCOUNTING is turned on, and can just implement a
      suitable account_process_tick().
      
      account_process_tick() now takes the task_struct * as an argument.
      Tested both with and without CONFIG_VIRT_CPU_ACCOUNTING.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa13a5a1
  21. 20 10月, 2007 1 次提交
  22. 17 10月, 2007 1 次提交
  23. 12 10月, 2007 1 次提交
    • P
      [POWERPC] Use 1TB segments · 1189be65
      Paul Mackerras 提交于
      This makes the kernel use 1TB segments for all kernel mappings and for
      user addresses of 1TB and above, on machines which support them
      (currently POWER5+, POWER6 and PA6T).
      
      We detect that the machine supports 1TB segments by looking at the
      ibm,processor-segment-sizes property in the device tree.
      
      We don't currently use 1TB segments for user addresses < 1T, since
      that would effectively prevent 32-bit processes from using huge pages
      unless we also had a way to revert to using 256MB segments.  That
      would be possible but would involve extra complications (such as
      keeping track of which segment size was used when HPTEs were inserted)
      and is not addressed here.
      
      Parts of this patch were originally written by Ben Herrenschmidt.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1189be65
  24. 03 10月, 2007 1 次提交
  25. 25 9月, 2007 1 次提交
  26. 14 9月, 2007 1 次提交
  27. 29 8月, 2007 1 次提交
    • K
      [POWERPC] Flush registers to proper task context · 0ee6c15e
      Kumar Gala 提交于
      When we flush register state for FP, Altivec, or SPE in flush_*_to_thread
      we need to respect the task_struct that the caller has passed to us.
      
      Most cases we are called with current, however sometimes (ptrace) we may
      be passed a different task_struct.
      
      This showed up when using gdbserver debugging a simple program that used
      floating point. When gdb tried to show the FP regs they all showed up as
      0, because the child's FP registers were never properly flushed to memory.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      0ee6c15e
  28. 26 7月, 2007 1 次提交
  29. 14 6月, 2007 1 次提交
  30. 09 5月, 2007 1 次提交
  31. 13 4月, 2007 1 次提交
    • B
      [POWERPC] Make tlb flush batch use lazy MMU mode · a741e679
      Benjamin Herrenschmidt 提交于
      The current tlb flush code on powerpc 64 bits has a subtle race since we
      lost the page table lock due to the possible faulting in of new PTEs
      after a previous one has been removed but before the corresponding hash
      entry has been evicted, which can leads to all sort of fatal problems.
      
      This patch reworks the batch code completely. It doesn't use the mmu_gather
      stuff anymore. Instead, we use the lazy mmu hooks that were added by the
      paravirt code. They have the nice property that the enter/leave lazy mmu
      mode pair is always fully contained by the PTE lock for a given range
      of PTEs. Thus we can guarantee that all batches are flushed on a given
      CPU before it drops that lock.
      
      We also generalize batching for any PTE update that require a flush.
      
      Batching is now enabled on a CPU by arch_enter_lazy_mmu_mode() and
      disabled by arch_leave_lazy_mmu_mode(). The code epects that this is
      always contained within a PTE lock section so no preemption can happen
      and no PTE insertion in that range from another CPU. When batching
      is enabled on a CPU, every PTE updates that need a hash flush will
      use the batch for that flush.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      a741e679
  32. 26 3月, 2007 1 次提交
  33. 22 3月, 2007 1 次提交
  34. 16 3月, 2007 1 次提交
    • M
      [POWERPC] Fix atomicity of TIF update in flush_thread() · f144e7c7
      Mathieu Desnoyers 提交于
      Fix atomicity of TIF update in flush_thread() for powerpc
      
      Fixes it correctly with *_ti_thread_flag.
      
      Race :
      
      parent process executing :
      sys_ptrace()
       (lock_kernel())
       (ptrace_get_task_struct(pid))
       arch_ptrace()
         ptrace_detach()
           ptrace_disable(child);
             clear_singlestep(child);
               clear_tsk_thread_flag(child, TIF_SINGLESTEP);
               (which clears the TIF_SINGLESTEP flag atomically from a different
                process)
       (put_task_struct(child))
       (unlock_kernel())
      
      And at the same time, in the child process :
      sys_execve()
       do_execve()
         search_binary_handler()
           load_elf_binary()
             flush_old_exec()
               flush_thread()
                 doing a non-atomic thread flag update
      
      Applies on 2.6.20.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f144e7c7
  35. 08 3月, 2007 1 次提交
    • P
      [POWERPC] Harden validate_sp against stack corruption · bb72c481
      Paul Mackerras 提交于
      If something has overflowed or corrupted the stack and causes an oops,
      and we try to print a stack trace, that will call validate_sp, which
      can itself cause an oops if the cpu field of the thread_info struct at
      the bottom of the stack has been corrupted (if CONFIG_IRQSTACKS is
      set).  This makes debugging harder.
      
      To avoid the second oops, this adds a check to make sure that the cpu
      number is reasonable before using it to check whether the stack is on
      the softirq or hardirq stack.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      bb72c481
  36. 16 10月, 2006 1 次提交
  37. 02 10月, 2006 1 次提交
    • S
      [PATCH] namespaces: utsname: use init_utsname when appropriate · 96b644bd
      Serge E. Hallyn 提交于
      In some places, particularly drivers and __init code, the init utsns is the
      appropriate one to use.  This patch replaces those with a the init_utsname
      helper.
      
      Changes: Removed several uses of init_utsname().  Hope I picked all the
      	right ones in net/ipv4/ipconfig.c.  These are now changed to
      	utsname() (the per-process namespace utsname) in the previous
      	patch (2/7)
      
      [akpm@osdl.org: CIFS fix]
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Herbert Poetzl <herbert@13thfloor.at>
      Cc: Andrey Savochkin <saw@sw.ru>
      Cc: Serge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      96b644bd