Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+32 -12
+23 -12
arch/x86/events/intel/core.c
··· 3734 3734 EVENT_ATTR_STR(cycles-ct, cycles_ct, "event=0x3c,in_tx=1,in_tx_cp=1"); 3735 3735 3736 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 3750 EVENT_PTR(tx_start), 3738 3751 EVENT_PTR(tx_commit), 3739 3752 EVENT_PTR(tx_abort), ··· 3759 3746 EVENT_PTR(el_conflict), 3760 3747 EVENT_PTR(cycles_t), 3761 3748 EVENT_PTR(cycles_ct), 3762 - EVENT_PTR(mem_ld_hsw), 3763 - EVENT_PTR(mem_st_hsw), 3764 - EVENT_PTR(td_slots_issued), 3765 - EVENT_PTR(td_slots_retired), 3766 - EVENT_PTR(td_fetch_bubbles), 3767 - EVENT_PTR(td_total_slots), 3768 - EVENT_PTR(td_total_slots_scale), 3769 - EVENT_PTR(td_recovery_bubbles), 3770 - EVENT_PTR(td_recovery_bubbles_scale), 3771 3749 NULL 3772 3750 }; 3751 + 3752 + static __init struct attribute **get_hsw_events_attrs(void) 3753 + { 3754 + return boot_cpu_has(X86_FEATURE_RTM) ? 3755 + merge_attr(hsw_events_attrs, hsw_tsx_events_attrs) : 3756 + hsw_events_attrs; 3757 + } 3773 3758 3774 3759 static ssize_t freeze_on_smi_show(struct device *cdev, 3775 3760 struct device_attribute *attr, ··· 4197 4186 4198 4187 x86_pmu.hw_config = hsw_hw_config; 4199 4188 x86_pmu.get_event_constraints = hsw_get_event_constraints; 4200 - x86_pmu.cpu_events = hsw_events_attrs; 4189 + x86_pmu.cpu_events = get_hsw_events_attrs(); 4201 4190 x86_pmu.lbr_double_abort = true; 4202 4191 extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? 4203 4192 hsw_format_attr : nhm_format_attr; ··· 4236 4225 4237 4226 x86_pmu.hw_config = hsw_hw_config; 4238 4227 x86_pmu.get_event_constraints = hsw_get_event_constraints; 4239 - x86_pmu.cpu_events = hsw_events_attrs; 4228 + x86_pmu.cpu_events = get_hsw_events_attrs(); 4240 4229 x86_pmu.limit_period = bdw_limit_period; 4241 4230 extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? 4242 4231 hsw_format_attr : nhm_format_attr; ··· 4294 4283 extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? 4295 4284 hsw_format_attr : nhm_format_attr; 4296 4285 extra_attr = merge_attr(extra_attr, skl_format_attr); 4297 - x86_pmu.cpu_events = hsw_events_attrs; 4286 + x86_pmu.cpu_events = get_hsw_events_attrs(); 4298 4287 intel_pmu_pebs_data_source_skl( 4299 4288 boot_cpu_data.x86_model == INTEL_FAM6_SKYLAKE_X); 4300 4289 pr_cont("Skylake events, ");
+8
arch/x86/events/intel/uncore_snbep.c
··· 3035 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 3044 void bdx_uncore_cpu_init(void) 3039 3045 { 3040 3046 if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) 3041 3047 bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; 3042 3048 uncore_msr_uncores = bdx_msr_uncores; 3049 + 3050 + hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints; 3043 3051 } 3044 3052 3045 3053 static struct intel_uncore_type bdx_uncore_ha = {
+1
kernel/events/core.c
··· 6676 6676 ns_inode = ns_path.dentry->d_inode; 6677 6677 ns_link_info->dev = new_encode_dev(ns_inode->i_sb->s_dev); 6678 6678 ns_link_info->ino = ns_inode->i_ino; 6679 + path_put(&ns_path); 6679 6680 } 6680 6681 } 6681 6682