]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.2/perf-x86-intel-generalize-dynamic-constraint-creation.patch
drop mips patch from all queues.
[thirdparty/kernel/stable-queue.git] / releases / 5.0.2 / perf-x86-intel-generalize-dynamic-constraint-creation.patch
1 From foo@baz Tue Mar 12 09:29:14 PDT 2019
2 From: "Peter Zijlstra (Intel)" <peterz@infradead.org>
3 Date: Tue, 5 Mar 2019 22:23:16 +0100
4 Subject: perf/x86/intel: Generalize dynamic constraint creation
5
6 From: "Peter Zijlstra (Intel)" <peterz@infradead.org>
7
8 Such that we can re-use it.
9
10 Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
11 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 arch/x86/events/intel/core.c | 51 +++++++++++++++++++++++++------------------
15 1 file changed, 30 insertions(+), 21 deletions(-)
16
17 --- a/arch/x86/events/intel/core.c
18 +++ b/arch/x86/events/intel/core.c
19 @@ -2769,6 +2769,35 @@ intel_stop_scheduling(struct cpu_hw_even
20 }
21
22 static struct event_constraint *
23 +dyn_constraint(struct cpu_hw_events *cpuc, struct event_constraint *c, int idx)
24 +{
25 + WARN_ON_ONCE(!cpuc->constraint_list);
26 +
27 + if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) {
28 + struct event_constraint *cx;
29 +
30 + /*
31 + * grab pre-allocated constraint entry
32 + */
33 + cx = &cpuc->constraint_list[idx];
34 +
35 + /*
36 + * initialize dynamic constraint
37 + * with static constraint
38 + */
39 + *cx = *c;
40 +
41 + /*
42 + * mark constraint as dynamic
43 + */
44 + cx->flags |= PERF_X86_EVENT_DYNAMIC;
45 + c = cx;
46 + }
47 +
48 + return c;
49 +}
50 +
51 +static struct event_constraint *
52 intel_get_excl_constraints(struct cpu_hw_events *cpuc, struct perf_event *event,
53 int idx, struct event_constraint *c)
54 {
55 @@ -2798,27 +2827,7 @@ intel_get_excl_constraints(struct cpu_hw
56 * only needed when constraint has not yet
57 * been cloned (marked dynamic)
58 */
59 - if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) {
60 - struct event_constraint *cx;
61 -
62 - /*
63 - * grab pre-allocated constraint entry
64 - */
65 - cx = &cpuc->constraint_list[idx];
66 -
67 - /*
68 - * initialize dynamic constraint
69 - * with static constraint
70 - */
71 - *cx = *c;
72 -
73 - /*
74 - * mark constraint as dynamic, so we
75 - * can free it later on
76 - */
77 - cx->flags |= PERF_X86_EVENT_DYNAMIC;
78 - c = cx;
79 - }
80 + c = dyn_constraint(cpuc, c, idx);
81
82 /*
83 * From here on, the constraint is dynamic.