diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-26 16:41:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-26 16:41:48 -0500 |
commit | 580e3d552ddf06537c7f36d1bfab04761489db9c (patch) | |
tree | 7f1fd20ce34a024d3fc1b9096fca1441a20e2e42 | |
parent | cd4b5d5d2777e8c167f022b46200f1c8504d1ef6 (diff) | |
parent | 4a31b424ac0656d1bb17520ee861144fe7a19664 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"Misc fixes: two PMU driver fixes and a memory leak fix"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/core: Fix memory leak triggered by perf --namespace
perf/x86/intel/uncore: Add event constraint for BDX PCU
perf/x86/intel: Hide TSX events when RTM is not supported
-rw-r--r-- | arch/x86/events/intel/core.c | 35 | ||||
-rw-r--r-- | arch/x86/events/intel/uncore_snbep.c | 8 | ||||
-rw-r--r-- | kernel/events/core.c | 1 |
3 files changed, 32 insertions, 12 deletions
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 43445da30cea..09c26a4f139c 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
@@ -3734,6 +3734,19 @@ EVENT_ATTR_STR(cycles-t, cycles_t, "event=0x3c,in_tx=1"); | |||
3734 | EVENT_ATTR_STR(cycles-ct, cycles_ct, "event=0x3c,in_tx=1,in_tx_cp=1"); | 3734 | EVENT_ATTR_STR(cycles-ct, cycles_ct, "event=0x3c,in_tx=1,in_tx_cp=1"); |
3735 | 3735 | ||
3736 | static struct attribute *hsw_events_attrs[] = { | 3736 | static struct attribute *hsw_events_attrs[] = { |
3737 | EVENT_PTR(mem_ld_hsw), | ||
3738 | EVENT_PTR(mem_st_hsw), | ||
3739 | EVENT_PTR(td_slots_issued), | ||
3740 | EVENT_PTR(td_slots_retired), | ||
3741 | EVENT_PTR(td_fetch_bubbles), | ||
3742 | EVENT_PTR(td_total_slots), | ||
3743 | EVENT_PTR(td_total_slots_scale), | ||
3744 | EVENT_PTR(td_recovery_bubbles), | ||
3745 | EVENT_PTR(td_recovery_bubbles_scale), | ||
3746 | NULL | ||
3747 | }; | ||
3748 | |||
3749 | static struct attribute *hsw_tsx_events_attrs[] = { | ||
3737 | EVENT_PTR(tx_start), | 3750 | EVENT_PTR(tx_start), |
3738 | EVENT_PTR(tx_commit), | 3751 | EVENT_PTR(tx_commit), |
3739 | EVENT_PTR(tx_abort), | 3752 | EVENT_PTR(tx_abort), |
@@ -3746,18 +3759,16 @@ static struct attribute *hsw_events_attrs[] = { | |||
3746 | EVENT_PTR(el_conflict), | 3759 | EVENT_PTR(el_conflict), |
3747 | EVENT_PTR(cycles_t), | 3760 | EVENT_PTR(cycles_t), |
3748 | EVENT_PTR(cycles_ct), | 3761 | EVENT_PTR(cycles_ct), |
3749 | EVENT_PTR(mem_ld_hsw), | ||
3750 | EVENT_PTR(mem_st_hsw), | ||
3751 | EVENT_PTR(td_slots_issued), | ||
3752 | EVENT_PTR(td_slots_retired), | ||
3753 | EVENT_PTR(td_fetch_bubbles), | ||
3754 | EVENT_PTR(td_total_slots), | ||
3755 | EVENT_PTR(td_total_slots_scale), | ||
3756 | EVENT_PTR(td_recovery_bubbles), | ||
3757 | EVENT_PTR(td_recovery_bubbles_scale), | ||
3758 | NULL | 3762 | NULL |
3759 | }; | 3763 | }; |
3760 | 3764 | ||
3765 | static __init struct attribute **get_hsw_events_attrs(void) | ||
3766 | { | ||
3767 | return boot_cpu_has(X86_FEATURE_RTM) ? | ||
3768 | merge_attr(hsw_events_attrs, hsw_tsx_events_attrs) : | ||
3769 | hsw_events_attrs; | ||
3770 | } | ||
3771 | |||
3761 | static ssize_t freeze_on_smi_show(struct device *cdev, | 3772 | static ssize_t freeze_on_smi_show(struct device *cdev, |
3762 | struct device_attribute *attr, | 3773 | struct device_attribute *attr, |
3763 | char *buf) | 3774 | char *buf) |
@@ -4186,7 +4197,7 @@ __init int intel_pmu_init(void) | |||
4186 | 4197 | ||
4187 | x86_pmu.hw_config = hsw_hw_config; | 4198 | x86_pmu.hw_config = hsw_hw_config; |
4188 | x86_pmu.get_event_constraints = hsw_get_event_constraints; | 4199 | x86_pmu.get_event_constraints = hsw_get_event_constraints; |
4189 | x86_pmu.cpu_events = hsw_events_attrs; | 4200 | x86_pmu.cpu_events = get_hsw_events_attrs(); |
4190 | x86_pmu.lbr_double_abort = true; | 4201 | x86_pmu.lbr_double_abort = true; |
4191 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? | 4202 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? |
4192 | hsw_format_attr : nhm_format_attr; | 4203 | hsw_format_attr : nhm_format_attr; |
@@ -4225,7 +4236,7 @@ __init int intel_pmu_init(void) | |||
4225 | 4236 | ||
4226 | x86_pmu.hw_config = hsw_hw_config; | 4237 | x86_pmu.hw_config = hsw_hw_config; |
4227 | x86_pmu.get_event_constraints = hsw_get_event_constraints; | 4238 | x86_pmu.get_event_constraints = hsw_get_event_constraints; |
4228 | x86_pmu.cpu_events = hsw_events_attrs; | 4239 | x86_pmu.cpu_events = get_hsw_events_attrs(); |
4229 | x86_pmu.limit_period = bdw_limit_period; | 4240 | x86_pmu.limit_period = bdw_limit_period; |
4230 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? | 4241 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? |
4231 | hsw_format_attr : nhm_format_attr; | 4242 | hsw_format_attr : nhm_format_attr; |
@@ -4283,7 +4294,7 @@ __init int intel_pmu_init(void) | |||
4283 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? | 4294 | extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? |
4284 | hsw_format_attr : nhm_format_attr; | 4295 | hsw_format_attr : nhm_format_attr; |
4285 | extra_attr = merge_attr(extra_attr, skl_format_attr); | 4296 | extra_attr = merge_attr(extra_attr, skl_format_attr); |
4286 | x86_pmu.cpu_events = hsw_events_attrs; | 4297 | x86_pmu.cpu_events = get_hsw_events_attrs(); |
4287 | intel_pmu_pebs_data_source_skl( | 4298 | intel_pmu_pebs_data_source_skl( |
4288 | boot_cpu_data.x86_model == INTEL_FAM6_SKYLAKE_X); | 4299 | boot_cpu_data.x86_model == INTEL_FAM6_SKYLAKE_X); |
4289 | pr_cont("Skylake events, "); | 4300 | pr_cont("Skylake events, "); |
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 95cb19f4e06f..f4e4168455a8 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c | |||
@@ -3035,11 +3035,19 @@ static struct intel_uncore_type *bdx_msr_uncores[] = { | |||
3035 | NULL, | 3035 | NULL, |
3036 | }; | 3036 | }; |
3037 | 3037 | ||
3038 | /* Bit 7 'Use Occupancy' is not available for counter 0 on BDX */ | ||
3039 | static struct event_constraint bdx_uncore_pcu_constraints[] = { | ||
3040 | EVENT_CONSTRAINT(0x80, 0xe, 0x80), | ||
3041 | EVENT_CONSTRAINT_END | ||
3042 | }; | ||
3043 | |||
3038 | void bdx_uncore_cpu_init(void) | 3044 | void bdx_uncore_cpu_init(void) |
3039 | { | 3045 | { |
3040 | if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) | 3046 | if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) |
3041 | bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; | 3047 | bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; |
3042 | uncore_msr_uncores = bdx_msr_uncores; | 3048 | uncore_msr_uncores = bdx_msr_uncores; |
3049 | |||
3050 | hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints; | ||
3043 | } | 3051 | } |
3044 | 3052 | ||
3045 | static struct intel_uncore_type bdx_uncore_ha = { | 3053 | static struct intel_uncore_type bdx_uncore_ha = { |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 9404c631bd3f..16beab4767e1 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -6676,6 +6676,7 @@ static void perf_fill_ns_link_info(struct perf_ns_link_info *ns_link_info, | |||
6676 | ns_inode = ns_path.dentry->d_inode; | 6676 | ns_inode = ns_path.dentry->d_inode; |
6677 | ns_link_info->dev = new_encode_dev(ns_inode->i_sb->s_dev); | 6677 | ns_link_info->dev = new_encode_dev(ns_inode->i_sb->s_dev); |
6678 | ns_link_info->ino = ns_inode->i_ino; | 6678 | ns_link_info->ino = ns_inode->i_ino; |
6679 | path_put(&ns_path); | ||
6679 | } | 6680 | } |
6680 | } | 6681 | } |
6681 | 6682 | ||