public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	mingo@elte.hu, Andi Kleen <ak@linux.intel.com>,
	"Liang, Kan" <kan.liang@intel.com>, Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH] perf/core: fix perf_proc_update_handler() bug
Date: Fri, 18 Jan 2019 12:14:34 -0200	[thread overview]
Message-ID: <20190118141434.GC3141@redhat.com> (raw)
In-Reply-To: <CABPqkBS30_Afu3a1hycMAnB5KaqdFe=JYPoENfZG4ZtUYAE7mQ@mail.gmail.com>

Em Thu, Jan 17, 2019 at 01:03:20PM -0800, Stephane Eranian escreveu:
> On Thu, Jan 10, 2019 at 5:17 PM Stephane Eranian <eranian@google.com> wrote:
> >
> > The perf_proc_update_handler() handles /proc/sys/kernel/perf_event_max_sample_rate
> > syctl variable.  When the PMU IRQ handler timing monitoring is disabled, i.e,
> > when /proc/sys/kernel/perf_cpu_time_max_percent is equal to 0 or 100,
> > then no modification to sysctl_perf_event_sample_rate is allowed to prevent
> > possible hang from wrong values.
> >
> > The problem is that the test to prevent modification is made after the
> > sysctl variable is modified in perf_proc_update_handler().
> >
> > You get an error:
> >
> > $ echo 10001 >/proc/sys/kernel/perf_event_max_sample_rate
> > echo: write error: invalid argument
> >
> > But the value is still modified causing all sorts of inconsistencies:
> >
> > $ cat /proc/sys/kernel/perf_event_max_sample_rate
> > 10001
> >
> > This patch fixes the problem by moving the parsing of the value after
> > the test.
> >
> > Signed-off-by: Stephane Eranian <eranian@google.com>
> 
> Ping.

Collected the Reviewed-by from Jiri and Andi, reproduced the problem
before the patch and I'm testing it to push to Ingo via perf/urgent,
thanks for the patch.

- Arnaldo

  parent reply	other threads:[~2019-01-18 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  1:17 [PATCH] perf/core: fix perf_proc_update_handler() bug Stephane Eranian
2019-01-17 21:03 ` Stephane Eranian
2019-01-17 22:09   ` Andi Kleen
2019-01-18 14:14   ` Arnaldo Carvalho de Melo [this message]
2019-01-18  9:52 ` Jiri Olsa
2019-01-22 11:35 ` [tip:perf/urgent] perf core: Fix " tip-bot for Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190118141434.GC3141@redhat.com \
    --to=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox