1. 27 1月, 2010 1 次提交
    • P
      perf: Reimplement frequency driven sampling · abd50713
      Peter Zijlstra 提交于
      There was a bug in the old period code that caused intel_pmu_enable_all()
      or native_write_msr_safe() to show up quite high in the profiles.
      
      In staring at that code it made my head hurt, so I rewrote it in a
      hopefully simpler fashion. Its now fully symetric between tick and
      overflow driven adjustments and uses less data to boot.
      
      The only complication is that it basically wants to do a u128 division.
      The code approximates that in a rather simple truncate until it fits
      fashion, taking care to balance the terms while truncating.
      
      This version does not generate that sampling artefact.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Cc: <stable@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      abd50713
  2. 17 1月, 2010 4 次提交
    • F
      perf: Better order flexible and pinned scheduling · 329c0e01
      Frederic Weisbecker 提交于
      When a task gets scheduled in. We don't touch the cpu bound events
      so the priority order becomes:
      
      	cpu pinned, cpu flexible, task pinned, task flexible.
      
      So schedule out cpu flexibles when a new task context gets in
      and correctly order the groups to schedule in:
      
      	task pinned, cpu flexible, task flexible.
      
      Cpu pinned groups don't need to be touched at this time.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      329c0e01
    • F
      perf: Don't schedule out/in pinned events on task tick · 7defb0f8
      Frederic Weisbecker 提交于
      We don't need to schedule in/out pinned events on task tick,
      now that pinned and flexible groups can be scheduled separately.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      7defb0f8
    • F
      perf: Allow pinned and flexible groups to be scheduled separately · 5b0311e1
      Frederic Weisbecker 提交于
      Tune the scheduling helpers so that we can choose to schedule either
      pinned and/or flexible groups from a context.
      
      And while at it, refactor a bit the naming of these helpers to make
      these more consistent and flexible.
      
      There is no (intended) change in scheduling behaviour in this
      patch.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      5b0311e1
    • F
      perf: Make __perf_event_sched_out static · 42cce92f
      Frederic Weisbecker 提交于
      __perf_event_sched_out doesn't need to be globally available, make
      it static.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      42cce92f
  3. 16 1月, 2010 3 次提交
    • F
      perf: Export software-only event group characteristic as a flag · d6f962b5
      Frederic Weisbecker 提交于
      Before scheduling an event group, we first check if a group can go
      on. We first check if the group is made of software only events
      first, in which case it is enough to know if the group can be
      scheduled in.
      
      For that purpose, we iterate through the whole group, which is
      wasteful as we could do this check when we add/delete an event to
      a group.
      
      So we create a group_flags field in perf event that can host
      characteristics from a group of events, starting with a first
      PERF_GROUP_SOFTWARE flag that reduces the check on the fast path.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      d6f962b5
    • F
      perf: Round robin flexible groups of events using list_rotate_left() · e2864173
      Frederic Weisbecker 提交于
      This is more proper that doing it through a list_for_each_entry()
      that breaks after the first entry.
      
      v2: Don't rotate pinned groups as its not needed to time share
      them.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      e2864173
    • F
      perf/core: Split context's event group list into pinned and non-pinned lists · 889ff015
      Frederic Weisbecker 提交于
      Split-up struct perf_event_context::group_list into pinned_groups
      and flexible_groups (non-pinned).
      
      This first appears to be useless as it duplicates various loops around
      the group list handlings.
      
      But it scales better in the fast-path in perf_sched_in(). We don't
      anymore iterate twice through the entire list to separate pinned and
      non-pinned scheduling. Instead we interate through two distinct lists.
      
      The another desired effect is that it makes easier to define distinct
      scheduling rules on both.
      
      Changes in v2:
      - Respectively rename pinned_grp_list and
        volatile_grp_list into pinned_groups and flexible_groups as per
        Ingo suggestion.
      - Various cleanups
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      889ff015
  4. 31 12月, 2009 1 次提交
  5. 28 12月, 2009 2 次提交
    • L
      perf events: Remove CONFIG_EVENT_PROFILE · 07b139c8
      Li Zefan 提交于
      Quoted from Ingo:
      
      | This reminds me - i think we should eliminate CONFIG_EVENT_PROFILE -
      | it's an unnecessary Kconfig complication. If both PERF_EVENTS and
      | EVENT_TRACING is enabled we should expose generic tracepoints.
      |
      | Nor is it limited to event 'profiling', so it has become a misnomer as
      | well.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B2F1557.2050705@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      07b139c8
    • P
      perf events: Remove arg from perf sched hooks · 49f47433
      Peter Zijlstra 提交于
      Since we only ever schedule the local cpu, there is no need to pass the
      cpu number to the perf sched hooks.
      
      This micro-optimizes things a bit.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      49f47433
  6. 23 12月, 2009 1 次提交
  7. 17 12月, 2009 3 次提交
  8. 16 12月, 2009 1 次提交
    • P
      perf_events: Fix perf_event_attr layout · f13c12c6
      Peter Zijlstra 提交于
      The miss-alignment of bp_addr created a 32bit hole, causing
      different structure packings on 32 and 64 bit machines.
      
      Fix that by moving __reserve_2 into that hole.
      
      Further, remove the useless struct and redundant __bp_reserve
      muck.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1260902591.8023.781.camel@laptop>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f13c12c6
  9. 15 12月, 2009 2 次提交
  10. 11 12月, 2009 1 次提交
  11. 10 12月, 2009 1 次提交
    • X
      perf_event: Fix perf_swevent_hrtimer() variable initialization · 21140f4d
      Xiao Guangrong 提交于
      fix:
      
       [<c0477471>] ? printk+0x1d/0x24
       [<c01c98f9>] ? perf_prepare_sample+0x269/0x280
       [<c0149231>] warn_slowpath_common+0x71/0xd0
       [<c01c98f9>] ? perf_prepare_sample+0x269/0x280
       [<c01492aa>] warn_slowpath_null+0x1a/0x20
       [<c01c98f9>] perf_prepare_sample+0x269/0x280
       [<c016e9f3>] ? cpu_clock+0x53/0x90
       [<c01cc368>] __perf_event_overflow+0x2a8/0x300
       [<c01ccc3b>] perf_event_overflow+0x1b/0x30
       [<c01ccccf>] perf_swevent_hrtimer+0x7f/0x120
      
      This is because 'data.raw' variable not initialize.
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B208E93.1010801@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      21140f4d
  12. 09 12月, 2009 4 次提交
  13. 06 12月, 2009 1 次提交
  14. 04 12月, 2009 1 次提交
  15. 02 12月, 2009 1 次提交
    • K
      perf: Don't free perf_mmap_data until work has been done · ec70ccd8
      Kristian Høgsberg 提交于
      In the CONFIG_PERF_USE_VMALLOC case, perf_mmap_data_free() only
      schedules the cleanup of the perf_mmap_data struct.  In that
      case we have to wait until the work has been done before we free
      data.
      Signed-off-by: NKristian Høgsberg <krh@bitplanet.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: <stable@kernel.org>
      LKML-Reference: <1259697901-1747-1-git-send-email-krh@bitplanet.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec70ccd8
  16. 01 12月, 2009 1 次提交
  17. 27 11月, 2009 1 次提交
  18. 26 11月, 2009 2 次提交
  19. 25 11月, 2009 1 次提交
    • F
      perf_events: Fix bad software/trace event recursion counting · fe612672
      Frederic Weisbecker 提交于
      Commit 4ed7c92d
      (perf_events: Undo some recursion damage) has introduced a bad
      reference counting of the recursion context. putting the context
      behaves like getting it, dropping every software/trace events
      after the first one in a context.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1259091502-5171-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fe612672
  20. 24 11月, 2009 2 次提交
  21. 23 11月, 2009 6 次提交
    • P
      perf_events: Restore sanity to scaling land · acd1d7c1
      Peter Zijlstra 提交于
      It is quite possible to call update_event_times() on a context
      that isn't actually running and thereby confuse the thing.
      
      perf stat was reporting !100% scale values for software counters
      (2e2af50b perf_events: Disable events when we detach them,
      solved the worst of that, but there was still some left).
      
      The thing that happens is that because we are not self-reaping
      (we have a caring parent) there is a time between the last
      schedule (out) and having do_exit() called which will detach the
      events.
      
      This period would be accounted as enabled,!running because the
      event->state==INACTIVE, even though !event->ctx->is_active.
      
      Similar issues could have been observed by calling read() on a
      event while the attached task was not scheduled in.
      
      Solve this by teaching update_event_times() about
      ctx->is_active.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1258984836.4531.480.camel@laptop>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      acd1d7c1
    • P
      perf_events: Undo some recursion damage · 4ed7c92d
      Peter Zijlstra 提交于
      Make perf_swevent_get_recursion_context return a context number
      and disable preemption.
      
      This could be used to remove the IRQ disable from the trace bit
      and index the per-cpu buffer with.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20091123103819.993226816@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4ed7c92d
    • P
      perf_events: Fix __perf_event_exit_task() vs. update_event_times() locking · f67218c3
      Peter Zijlstra 提交于
      Move the update_event_times() call in __perf_event_exit_task()
      into list_del_event() because that holds the proper lock
      (ctx->lock) and seems a more natural place to do the last time
      update.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091123103819.842455480@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f67218c3
    • P
      perf_events: Update the context time on exit · 5e942bb3
      Peter Zijlstra 提交于
      It appeared we did call update_event_times() on exit, but we
      failed to update the context time, which renders the former
      moot.
      
      Locking is a bit iffy, we call update_event_times under
      ctx->mutex instead of ctx->lock - the next patch fixes this.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091123103819.764207355@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5e942bb3
    • P
      perf_events: Disable events when we detach them · 2e2af50b
      Peter Zijlstra 提交于
      If we leave the event in STATE_INACTIVE, any read of the event
      after the detach will increase the running count but not the
      enabled count and cause funny scaling artefacts.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091123103819.689055515@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2e2af50b
    • P
      perf_events: Fix style nits · 6c2bfcbe
      Peter Zijlstra 提交于
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091123103819.613427378@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6c2bfcbe