1. 06 8月, 2009 1 次提交
    • S
      ring-buffer: fix check of try_to_discard result · 0f2541d2
      Steven Rostedt 提交于
      The function ring_buffer_discard_commit inversed the code path
      of the result of try_to_discard. It should skip incrementing the
      entry counter if try_to_discard succeeded. But instead, it increments
      the entry conder if it succeeded to discard, and does not increment
      it if it fails.
      
      The result of this bug is that filtering will make the stat counters
      incorrect.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0f2541d2
  2. 29 7月, 2009 2 次提交
    • L
      tracing: Fix missing function_graph events when we splice_read from trace_pipe · 74e7ff8c
      Lai Jiangshan 提交于
      About a half events are missing when we splice_read
      from trace_pipe. They are unexpectedly consumed because we ignore
      the TRACE_TYPE_NO_CONSUME return value used by the function graph
      tracer when it needs to consume the events by itself to walk on
      the ring buffer.
      
      The same problem appears with ftrace_dump()
      
      Example of an output before this patch:
      
      1)               |      ktime_get_real() {
      1)   2.846 us    |          read_hpet();
      1)   4.558 us    |        }
      1)   6.195 us    |      }
      
      After this patch:
      
      0)               |      ktime_get_real() {
      0)               |        getnstimeofday() {
      0)   1.960 us    |          read_hpet();
      0)   3.597 us    |        }
      0)   5.196 us    |      }
      
      The fix also applies on 2.6.30
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: stable@kernel.org
      LKML-Reference: <4A6EEC52.90704@cn.fujitsu.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      74e7ff8c
    • L
      tracing: Fix invalid function_graph entry · 38ceb592
      Lai Jiangshan 提交于
      When print_graph_entry() computes a function call entry event, it needs
      to also check the next entry to guess if it matches the return event of
      the current function entry.
      In order to look at this next event, it needs to consume the current
      entry before going ahead in the ring buffer.
      
      However, if the current event that gets consumed is the last one in the
      ring buffer head page, the ring_buffer may reuse the page for writers.
      The consumed entry will then become invalid because of possible
      racy overwriting.
      
      Me must then handle this entry by making a copy of it.
      
      The fix also applies on 2.6.30
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: stable@kernel.org
      LKML-Reference: <4A6EEAEC.3050508@cn.fujitsu.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      38ceb592
  3. 28 7月, 2009 2 次提交
  4. 25 7月, 2009 1 次提交
  5. 23 7月, 2009 11 次提交
  6. 22 7月, 2009 1 次提交
    • P
      softirq: introduce tasklet_hrtimer infrastructure · 9ba5f005
      Peter Zijlstra 提交于
      commit ca109491 (hrtimer: removing all ur callback modes) moved all
      hrtimer callbacks into hard interrupt context when high resolution
      timers are active. That breaks code which relied on the assumption
      that the callback happens in softirq context.
      
      Provide a generic infrastructure which combines tasklets and hrtimers
      together to provide an in-softirq hrtimer experience.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: torvalds@linux-foundation.org
      Cc: kaber@trash.net
      Cc: David Miller <davem@davemloft.net>
      LKML-Reference: <1248265724.27058.1366.camel@twins>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      9ba5f005
  7. 21 7月, 2009 1 次提交
    • T
      genirq: Delegate irq affinity setting to the irq thread · 591d2fb0
      Thomas Gleixner 提交于
      irq_set_thread_affinity() calls set_cpus_allowed_ptr() which might
      sleep, but irq_set_thread_affinity() is called with desc->lock held
      and can be called from hard interrupt context as well. The code has
      another bug as it does not hold a ref on the task struct as required
      by set_cpus_allowed_ptr().
      
      Just set the IRQTF_AFFINITY bit in action->thread_flags. The next time
      the thread runs it migrates itself. Solves all of the above problems
      nicely.
      
      Add kerneldoc to irq_set_thread_affinity() while at it.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <new-submission>
      591d2fb0
  8. 19 7月, 2009 2 次提交
  9. 18 7月, 2009 6 次提交
  10. 17 7月, 2009 1 次提交
    • X
      tracing/function: Fix the return value of ftrace_trace_onoff_callback() · 04aef32d
      Xiao Guangrong 提交于
      ftrace_trace_onoff_callback() will return an error even if we do the
      right operation, for example:
      
       # echo _spin_*:traceon:10 > set_ftrace_filter
       -bash: echo: write error: Invalid argument
       # cat set_ftrace_filter
       #### all functions enabled ####
       _spin_trylock_bh:traceon:count=10
       _spin_unlock_irq:traceon:count=10
       _spin_unlock_bh:traceon:count=10
       _spin_lock_irq:traceon:count=10
       _spin_unlock:traceon:count=10
       _spin_trylock:traceon:count=10
       _spin_unlock_irqrestore:traceon:count=10
       _spin_lock_irqsave:traceon:count=10
       _spin_lock_bh:traceon:count=10
       _spin_lock:traceon:count=10
      
      We want to set _spin_*:traceon:10 to set_ftrace_filter, it complains
      with "Invalid argument", but the operation is successful.
      
      This is because ftrace_process_regex() returns the number of functions that
      matched the pattern. If the number is not 0, this value is returned
      by ftrace_regex_write() whereas we want to return the number of bytes
      virtually written.
      Also the file offset pointer is not updated in this case.
      
      If the number of matched functions is lower than the number of bytes written
      by the user, this results to a reprocessing of the string given by the user with
      a lower size, leading to a malformed ftrace regex and then a -EINVAL returned.
      
      So, this patch fixes it by returning 0 if no error occured.
      The fix also applies on 2.6.30
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: stable@kernel.org
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      04aef32d
  11. 13 7月, 2009 3 次提交
    • S
      tracing/function-profiler: do not free per cpu variable stat · 6ab5d668
      Steven Rostedt 提交于
      The per cpu variable stat is freeded if we fail to allocate a name
      on start up. This was due to stat at first being allocated in the
      initial design. But since then, it has become a static per cpu variable
      but the free on error was not removed.
      
      Also added __init annotation to the function that this is in.
      
      [ Impact: prevent possible memory corruption on low mem at boot up ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6ab5d668
    • C
      perf_counter: Fix the tracepoint channel to perfcounters · d4d7d0b9
      Chris Wilson 提交于
      Fix a missed rename in EVENT_PROFILE support so that it gets
      built and allows tracepoint tracing from the 'perf' tool.
      
      Fix a typo in the (never before built & enabled) portion in
      perf_counter.c as well, and update that code to the
      attr.config changes as well.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Gamari <bgamari.foss@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1246869094-21237-1-git-send-email-chris@chris-wilson.co.uk>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d4d7d0b9
    • A
      headers: smp_lock.h redux · 405f5571
      Alexey Dobriyan 提交于
      * Remove smp_lock.h from files which don't need it (including some headers!)
      * Add smp_lock.h to files which do need it
      * Make smp_lock.h include conditional in hardirq.h
        It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT
      
        This will make hardirq.h inclusion cheaper for every PREEMPT=n config
        (which includes allmodconfig/allyesconfig, BTW)
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      405f5571
  12. 11 7月, 2009 3 次提交
  13. 10 7月, 2009 6 次提交
    • T
      hrtimer: Fix migration expiry check · 6ff7041d
      Thomas Gleixner 提交于
      The timer migration expiry check should prevent the migration of a
      timer to another CPU when the timer expires before the next event is
      scheduled on the other CPU. Migrating the timer might delay it because
      we can not reprogram the clock event device on the other CPU. But the
      code implementing that check has two flaws:
      
      - for !HIGHRES the check compares the expiry value with the clock
        events device expiry value which is wrong for CLOCK_REALTIME based
        timers.
      
      - the check is racy. It holds the hrtimer base lock of the target CPU,
        but the clock event device expiry value can be modified
        nevertheless, e.g. by an timer interrupt firing.
      
      The !HIGHRES case is easy to fix as we can enqueue the timer on the
      cpu which was selected by the load balancer. It runs the idle
      balancing code once per jiffy anyway. So the maximum delay for the
      timer is the same as when we keep the tick on the current cpu going.
      
      In the HIGHRES case we can get the next expiry value from the hrtimer
      cpu_base of the target CPU and serialize the update with the cpu_base
      lock. This moves the lock section in hrtimer_interrupt() so we can set
      next_event to KTIME_MAX while we are handling the expired timers and
      set it to the next expiry value after we handled the timers under the
      base lock. While the expired timers are processed timer migration is
      blocked because the expiry time of the timer is always <= KTIME_MAX.
      
      Also remove the now useless clockevents_get_next_event() function.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      6ff7041d
    • T
      hrtimer: migration: do not check expiry time on current CPU · 7e0c5086
      Thomas Gleixner 提交于
      The timer migration code needs to check whether the expiry time of the
      timer is before the programmed clock event expiry time when the timer
      is enqueued on another CPU because we can not reprogram the timer
      device on the other CPU. The current logic checks the expiry time even
      if we enqueue on the current CPU when nohz_get_load_balancer() returns
      current CPU. This might lead to an endless loop in the expiry check
      code when the expiry time of the timer is before the current
      programmed next event.
      
      Check whether nohz_get_load_balancer() returns current CPU and skip
      the expiry check if this is the case.
      
      The bug was triggered from the networking code. The patch fixes the
      regression http://bugzilla.kernel.org/show_bug.cgi?id=13738
      (Soft-Lockup/Race in networking in 2.6.31-rc1+195)
      
      Cc: Arun Bharadwaj <arun@linux.vnet.ibm.com
      Tested-by: NJoao Correia <joaomiguelcorreia@gmail.com>
      Tested-by: NAndres Freund <andres@anarazel.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      7e0c5086
    • F
      sched: Fix rt_rq->pushable_tasks initialization in init_rt_rq() · c20b08e3
      Fabio Checconi 提交于
      init_rt_rq() initializes only rq->rt.pushable_tasks, and not the
      pushable_tasks field of the passed rt_rq.  The plist is not used
      uninitialized since the only pushable_tasks plists used are the
      ones of root rt_rqs; anyway reinitializing the list on every group
      creation corrupts the root plist, losing its previous contents.
      Signed-off-by: NFabio Checconi <fabio@gandalf.sssup.it>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20090615185638.GK21741@gandalf.sssup.it>
      CC: Gregory Haskins <ghaskins@novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c20b08e3
    • L
      sched: Reset sched stats on fork() · 7793527b
      Lucas De Marchi 提交于
      The sched_stat fields are currently not reset upon fork.
      Ingo's recent commit 6c594c21
      did reset nr_migrations, but it didn't reset any of the
      others.
      
      This patch resets all sched_stat fields on fork.
      Signed-off-by: NLucas De Marchi <lucas.de.marchi@gmail.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <193b0f820907090457s7a3662f4gcdecdc22fcae857b@mail.gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7793527b
    • P
      sched_rt: Fix overload bug on rt group scheduling · a1ba4d8b
      Peter Zijlstra 提交于
      Fixes an easily triggerable BUG() when setting process affinities.
      
      Make sure to count the number of migratable tasks in the same place:
      the root rt_rq. Otherwise the number doesn't make sense and we'll hit
      the BUG in set_cpus_allowed_rt().
      
      Also, make sure we only count tasks, not groups (this is probably
      already taken care of by the fact that rt_se->nr_cpus_allowed will be 0
      for groups, but be more explicit)
      Tested-by: NThomas Gleixner <tglx@linutronix.de>
      CC: stable@kernel.org
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NGregory Haskins <ghaskins@novell.com>
      LKML-Reference: <1247067476.9777.57.camel@twins>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a1ba4d8b
    • P
      perf_counter: Stop open coding unclone_ctx · 71a851b4
      Peter Zijlstra 提交于
      Instead of open coding the unclone context thingy, put it in
      a common function.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      71a851b4