Skip to content

Commit bf7f1c7

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "A bogus warning fix, a counter width handling fix affecting certain machines, plus a oneliner hw-enablement patch for Knights Mill CPUs" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Remove invalid warning from list_update_cgroup_even()t perf/x86: Fix full width counter, counter overflow perf/x86/intel: Enable C-state residency events for Knights Mill
2 parents 5b43f97 + 8fc31ce commit bf7f1c7

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

arch/x86/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ u64 x86_perf_event_update(struct perf_event *event)
6969
int shift = 64 - x86_pmu.cntval_bits;
7070
u64 prev_raw_count, new_raw_count;
7171
int idx = hwc->idx;
72-
s64 delta;
72+
u64 delta;
7373

7474
if (idx == INTEL_PMC_IDX_FIXED_BTS)
7575
return 0;

arch/x86/events/intel/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4034,7 +4034,7 @@ __init int intel_pmu_init(void)
40344034

40354035
/* Support full width counters using alternative MSR range */
40364036
if (x86_pmu.intel_cap.full_width_write) {
4037-
x86_pmu.max_period = x86_pmu.cntval_mask;
4037+
x86_pmu.max_period = x86_pmu.cntval_mask >> 1;
40384038
x86_pmu.perfctr = MSR_IA32_PMC0;
40394039
pr_cont("full-width counters, ");
40404040
}

arch/x86/events/intel/cstate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
540540
X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates),
541541

542542
X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNL, knl_cstates),
543+
X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates),
543544
{ },
544545
};
545546
MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match);

kernel/events/core.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -903,17 +903,14 @@ list_update_cgroup_event(struct perf_event *event,
903903
*/
904904
cpuctx = __get_cpu_context(ctx);
905905

906-
/* Only set/clear cpuctx->cgrp if current task uses event->cgrp. */
907-
if (perf_cgroup_from_task(current, ctx) != event->cgrp) {
908-
/*
909-
* We are removing the last cpu event in this context.
910-
* If that event is not active in this cpu, cpuctx->cgrp
911-
* should've been cleared by perf_cgroup_switch.
912-
*/
913-
WARN_ON_ONCE(!add && cpuctx->cgrp);
914-
return;
915-
}
916-
cpuctx->cgrp = add ? event->cgrp : NULL;
906+
/*
907+
* cpuctx->cgrp is NULL until a cgroup event is sched in or
908+
* ctx->nr_cgroup == 0 .
909+
*/
910+
if (add && perf_cgroup_from_task(current, ctx) == event->cgrp)
911+
cpuctx->cgrp = event->cgrp;
912+
else if (!add)
913+
cpuctx->cgrp = NULL;
917914
}
918915

919916
#else /* !CONFIG_CGROUP_PERF */

0 commit comments

Comments
 (0)