linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Luis Claudio R. Goncalves" <lclaudio@uudg.org>,
	ldv@altlinux.org, esyr@redhat.com,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 1/8] perf: Allow to block process in syscall tracepoints
Date: Fri, 7 Dec 2018 09:44:53 +0100	[thread overview]
Message-ID: <20181207084453.GA1727@krava> (raw)
In-Reply-To: <20181206131946.2c47f556@vmware.local.home>

On Thu, Dec 06, 2018 at 01:19:46PM -0500, Steven Rostedt wrote:
> On Thu, 6 Dec 2018 09:34:00 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > > 
> > > I don't understand this.. why are we using schedule_timeout() and all
> > > that?  
> > 
> > Urgh.. in fact, the more I look at this the more I hate it.
> > 
> > We want to block in __perf_output_begin(), but we cannot because both
> > tracepoints and perf will have preemptability disabled down there.
> > 
> > So what we do is fail the event, fake the lost count and go all the way
> > up that callstack, detect the failure and then poll-wait and retry.
> > 
> > And only do this for a few special events...  *yuck*
> 
> Since this is a special case, we should add a new option to the perf
> system call that, 1 states that it wants the traced process to block
> (and must have PTRACE permission to do so) and 2, after it reads from
> the buffer, it needs to check a bit that says "this process is blocked,
> please wake it up" and then do another perf call to kick the process to
> continue.

so instead of polling the traced process would properly wait for tracer
to kick him again after it reads/frees the buffer

I guess we could use the control mmap page (struct perf_event_mmap_page)
to communicate the 'we are block-ed' message to the tracer and have new
ioctl to wake the waiting process

jirka

> 
> I really dislike the polling too. But because this is not a default
> case, and is a new feature, we can add more infrastructure to make it
> work properly, instead of trying to hack the current method into
> something that does something poorly.
> 
> -- Steve

  reply	other threads:[~2018-12-07  8:45 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 16:05 [RFC 1/8] perf: Block perf calls for system call tracepoints Jiri Olsa
2018-12-05 16:05 ` [PATCH 1/8] perf: Allow to block process in syscall tracepoints Jiri Olsa
2018-12-05 17:35   ` Steven Rostedt
2018-12-05 17:56     ` Jiri Olsa
2018-12-06  8:09   ` Peter Zijlstra
2018-12-06 10:30     ` Jiri Olsa
2018-12-06  8:10   ` Peter Zijlstra
2018-12-06  8:24     ` Jiri Olsa
2018-12-06 10:31       ` Peter Zijlstra
2018-12-06  8:34     ` Peter Zijlstra
2018-12-06 10:31       ` Jiri Olsa
2018-12-06 18:19       ` Steven Rostedt
2018-12-07  8:44         ` Jiri Olsa [this message]
2018-12-07  8:58         ` Peter Zijlstra
2018-12-07 13:41           ` Steven Rostedt
2018-12-07 15:11             ` Peter Zijlstra
2018-12-07 15:49               ` Arnaldo Carvalho de Melo
2018-12-08 10:41                 ` Peter Zijlstra
2018-12-08 17:34                   ` Steven Rostedt
2018-12-07 20:14               ` Steven Rostedt
2018-12-08 10:44                 ` Peter Zijlstra
2018-12-08 17:38                   ` Steven Rostedt
2018-12-10 10:18                     ` Peter Zijlstra
2018-12-13  0:39                       ` Dmitry V. Levin
2018-12-13  1:26                         ` Steven Rostedt
2018-12-13  1:49                           ` Dmitry V. Levin
2018-12-13 10:01                           ` Peter Zijlstra
2018-12-13 10:05                             ` Peter Zijlstra
2018-12-13 10:08                             ` Peter Zijlstra
2018-12-13 11:29                             ` Jiri Olsa
2018-12-06  8:17   ` Peter Zijlstra
2018-12-06 10:27     ` Jiri Olsa
2018-12-05 16:05 ` [PATCH 2/8] perf tools: Sync uapi perf_event.h Jiri Olsa
2018-12-05 16:05 ` [PATCH 3/8] perf record: Add --block option Jiri Olsa
2018-12-05 16:05 ` [PATCH 4/8] perf trace: " Jiri Olsa
2018-12-05 16:05 ` [PATCH 5/8] perf tools: Add block term support for tracepoints Jiri Olsa
2018-12-05 16:05 ` [PATCH 6/8] perf tools: Add ordered_events__flush_time interface Jiri Olsa
2018-12-14 21:00   ` [tip:perf/core] perf ordered_events: " tip-bot for Jiri Olsa
2018-12-18 14:27   ` tip-bot for Jiri Olsa
2018-12-05 16:05 ` [PATCH 7/8] perf trace: Move event delivery to deliver_event function Jiri Olsa
2018-12-14 21:01   ` [tip:perf/core] perf trace: Move event delivery to a new deliver_event() function tip-bot for Jiri Olsa
2018-12-18 14:28   ` tip-bot for Jiri Olsa
2018-12-05 16:05 ` [PATCH 8/8] perf trace: Add ordered processing for --block option Jiri Olsa
2018-12-14 21:02   ` [tip:perf/core] perf trace: Add ordered processing tip-bot for Jiri Olsa
2018-12-18 14:29   ` tip-bot for Jiri Olsa

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=20181207084453.GA1727@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=esyr@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=lclaudio@uudg.org \
    --cc=ldv@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).