lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220614103751.1395645-1-yajun.deng@linux.dev>
Date:   Tue, 14 Jun 2022 18:37:51 +0800
From:   Yajun Deng <yajun.deng@...ux.dev>
To:     peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
        mark.rutland@....com, alexander.shishkin@...ux.intel.com,
        jolsa@...nel.org, namhyung@...nel.org, eranian@...gle.com
Cc:     linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yajun Deng <yajun.deng@...ux.dev>
Subject: [PATCH] perf/core: fix perf_event_mux_interval_ms when set zero

The perf_event_mux_interval_ms is set to zero or one by default.
It can't change back when someone changes it from zero to another
value.

Make perf_event_mux_interval_ms to PERF_CPU_HRTIMER when set zero.

Fixes: 62b856397927 ("perf: Add sysfs entry to adjust multiplexing interval per PMU")
Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
---
 kernel/events/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 61ad10862c21..73c8c7462bbf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10954,9 +10954,12 @@ perf_event_mux_interval_ms_store(struct device *dev,
 	if (ret)
 		return ret;
 
-	if (timer < 1)
+	if (timer < 0)
 		return -EINVAL;
 
+	if (timer < 1)
+		timer = PERF_CPU_HRTIMER;
+
 	/* same value, noting to do */
 	if (timer == pmu->hrtimer_interval_ms)
 		return count;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ