]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Feb 2015 23:43:55 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Feb 2015 23:43:55 +0000 (15:43 -0800)
Pull perf updates from Ingo Molnar:
 "Kernel side changes:

   - AMD range breakpoints support:

     Extend breakpoint tools and core to support address range through
     perf event with initial backend support for AMD extended
     breakpoints.

     The syntax is:

         perf record -e mem:addr/len:type

     For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512)

         perf record -e mem:0x1000/512:w

   - event throttling/rotating fixes

   - various event group handling fixes, cleanups and general paranoia
     code to be more robust against bugs in the future.

    - kernel stack overhead fixes

  User-visible tooling side changes:

   - Show precise number of samples in at the end of a 'record' session,
     if processing build ids, since we will then traverse the whole
     perf.data file and see all the PERF_RECORD_SAMPLE records,
     otherwise stop showing the previous off-base heuristicly counted
     number of "samples" (Namhyung Kim).

   - Support to read compressed module from build-id cache (Namhyung
     Kim)

   - Enable sampling loads and stores simultaneously in 'perf mem'
     (Stephane Eranian)

   - 'perf diff' output improvements (Namhyung Kim)

   - Fix error reporting for evsel pgfault constructor (Arnaldo Carvalho
     de Melo)

  Tooling side infrastructure changes:

   - Cache eh/debug frame offset for dwarf unwind (Namhyung Kim)

   - Support parsing parameterized events (Cody P Schafer)

   - Add support for IP address formats in libtraceevent (David Ahern)

  Plus other misc fixes"

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (48 commits)
  perf: Decouple unthrottling and rotating
  perf: Drop module reference on event init failure
  perf: Use POLLIN instead of POLL_IN for perf poll data in flag
  perf: Fix put_event() ctx lock
  perf: Fix move_group() order
  perf: Fix event->ctx locking
  perf: Add a bit of paranoia
  perf symbols: Convert lseek + read to pread
  perf tools: Use perf_data_file__fd() consistently
  perf symbols: Support to read compressed module from build-id cache
  perf evsel: Set attr.task bit for a tracking event
  perf header: Set header version correctly
  perf record: Show precise number of samples
  perf tools: Do not use __perf_session__process_events() directly
  perf callchain: Cache eh/debug frame offset for dwarf unwind
  perf tools: Provide stub for missing pthread_attr_setaffinity_np
  perf evsel: Don't rely on malloc working for sz 0
  tools lib traceevent: Add support for IP address formats
  perf ui/tui: Show fatal error message only if exists
  perf tests: Fix typo in sample-parsing.c
  ...

1  2 
kernel/sched/core.c

diff --combined kernel/sched/core.c
index 5eab11d4b747df5a5ff75a9e6558444c37b5c18a,ae1188f626938ec9e981e56341543732c2668c3a..1612578a5b7afb573893a104d850293127bb96de
@@@ -1082,7 -1082,7 +1082,7 @@@ void set_task_cpu(struct task_struct *p
                if (p->sched_class->migrate_task_rq)
                        p->sched_class->migrate_task_rq(p, new_cpu);
                p->se.nr_migrations++;
-               perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0);
+               perf_sw_event_sched(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 0);
        }
  
        __set_task_cpu(p, new_cpu);
@@@ -1814,10 -1814,6 +1814,10 @@@ void __dl_clear_params(struct task_stru
        dl_se->dl_period = 0;
        dl_se->flags = 0;
        dl_se->dl_bw = 0;
 +
 +      dl_se->dl_throttled = 0;
 +      dl_se->dl_new = 1;
 +      dl_se->dl_yielded = 0;
  }
  
  /*
@@@ -1843,7 -1839,7 +1843,7 @@@ static void __sched_fork(unsigned long 
  #endif
  
        RB_CLEAR_NODE(&p->dl.rb_node);
 -      hrtimer_init(&p->dl.dl_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 +      init_dl_task_timer(&p->dl);
        __dl_clear_params(p);
  
        INIT_LIST_HEAD(&p->rt.run_list);
@@@ -2053,9 -2049,6 +2053,9 @@@ static inline int dl_bw_cpus(int i
   * allocated bandwidth to reflect the new situation.
   *
   * This function is called while holding p's rq->lock.
 + *
 + * XXX we should delay bw change until the task's 0-lag point, see
 + * __setparam_dl().
   */
  static int dl_overflow(struct task_struct *p, int policy,
                       const struct sched_attr *attr)
@@@ -3258,31 -3251,15 +3258,31 @@@ __setparam_dl(struct task_struct *p, co
  {
        struct sched_dl_entity *dl_se = &p->dl;
  
 -      init_dl_task_timer(dl_se);
        dl_se->dl_runtime = attr->sched_runtime;
        dl_se->dl_deadline = attr->sched_deadline;
        dl_se->dl_period = attr->sched_period ?: dl_se->dl_deadline;
        dl_se->flags = attr->sched_flags;
        dl_se->dl_bw = to_ratio(dl_se->dl_period, dl_se->dl_runtime);
 -      dl_se->dl_throttled = 0;
 -      dl_se->dl_new = 1;
 -      dl_se->dl_yielded = 0;
 +
 +      /*
 +       * Changing the parameters of a task is 'tricky' and we're not doing
 +       * the correct thing -- also see task_dead_dl() and switched_from_dl().
 +       *
 +       * What we SHOULD do is delay the bandwidth release until the 0-lag
 +       * point. This would include retaining the task_struct until that time
 +       * and change dl_overflow() to not immediately decrement the current
 +       * amount.
 +       *
 +       * Instead we retain the current runtime/deadline and let the new
 +       * parameters take effect after the current reservation period lapses.
 +       * This is safe (albeit pessimistic) because the 0-lag point is always
 +       * before the current scheduling deadline.
 +       *
 +       * We can still have temporary overloads because we do not delay the
 +       * change in bandwidth until that time; so admission control is
 +       * not on the safe side. It does however guarantee tasks will never
 +       * consume more than promised.
 +       */
  }
  
  /*
@@@ -4665,9 -4642,6 +4665,9 @@@ int cpuset_cpumask_can_shrink(const str
        struct dl_bw *cur_dl_b;
        unsigned long flags;
  
 +      if (!cpumask_weight(cur))
 +              return ret;
 +
        rcu_read_lock_sched();
        cur_dl_b = dl_bw_of(cpumask_any(cur));
        trial_cpus = cpumask_weight(trial);