[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cj4=3DNz=kKhVbx0uKYwbbaQF6ZdjkezKPdT67j8rcEMg@mail.gmail.com>
Date: Tue, 14 Jun 2022 15:08:15 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Yajun Deng <yajun.deng@...ux.dev>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Stephane Eranian <eranian@...gle.com>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf/core: fix perf_event_mux_interval_ms when set zero
Hello,
On Tue, Jun 14, 2022 at 3:38 AM Yajun Deng <yajun.deng@...ux.dev> wrote:
>
> The perf_event_mux_interval_ms is set to zero or one by default.
I see that __perf_mux_hrtimer_init() sets it to PERF_CPU_HRTIMER
if it's less than 1.
Thanks,
Namhyung
> 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