linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Don Zickus <dzickus@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mike Galbraith <efault@gmx.de>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 04/10] perf record: Filter out POLLHUP'ed file descriptors
Date: Mon, 8 Sep 2014 10:46:16 -0300	[thread overview]
Message-ID: <20140908134615.GD2773@kernel.org> (raw)
In-Reply-To: <20140906203915.GA9843@krava.brq.redhat.com>

Em Sat, Sep 06, 2014 at 10:39:15PM +0200, Jiri Olsa escreveu:
> On Fri, Sep 05, 2014 at 11:07:56AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Fri, Sep 05, 2014 at 11:42:59AM +0300, Adrian Hunter escreveu:
> > > On 09/04/2014 06:19 PM, Arnaldo Carvalho de Melo wrote:
> > > > Em Thu, Sep 04, 2014 at 03:32:08PM +0300, Adrian Hunter escreveu:
> > > No I was meaning something different. For example, 'perf record' opens an
> > > event for 2 processes per-cpu and gets 4 file descriptors:

> > > 	task1	task2
> > > cpu0	fd0	fd1
> > > cpu1	fd2	fd3

> > > Now, perf record will mmap fd0 and fd2 and set-output fd1->fd0
> > > and fd3->fd2.

> > > pollfds includes only fd0 and fd2.

> > > But if task2 exits, the POLLHUP will appear on fd1 and fd3.

> > So? We are not interested in fd1 and fd3, since all our reading is done
> > on fd0 and fd2 mmaps, no?

> hm, what if task1 (fd0, fd2) exits first.. perf record will exit,
> but it still has to read task2..?

Ok, what happens in that case, i.e. when the fds that were set to be the
ones to be polled, gets nuked, does the set-output command gets just
undone? Or does the mmap stands, receiving the events from the remaining
fds and the polling notifications get sent to, in this case, fd3 and
fd1?

I'll look at the kernel code for that...
 
> > I.e. when we ask the kernel to point fd B to fd A's mmap (what you
> > called set-output) and fd B inserts an event into fd A's mmap ring
> > buffer, we get fd A poll return as POLLRD, no?

> > Have to check... Otherwise we would have to poll all fds all the time,
> > not just the ones mmaping, right?

> > > I think Jiri's patchset changed pollfds to include all fds for that reason.

> hm, I did not think of that.. ;-) I needed more grained feedback
> for future features like cpu hotplug

So this is good for something you didn't tried to fix (and document) but
good for something that may be nice in the future? Grumpf, we have
already way too much stuff that will be eventually used but is not used
right now :-\
 
> > It did? I have to look again, probably went together with other changes,
> > has it?
> 
> it was done by replacing 'int' with 'struct poll_item' for evsel::fd xyarray

Well, will look into that as soon as I see the need for it. I.e. after I
clarify the discussion above.

- Arnaldo

  reply	other threads:[~2014-09-08 13:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 21:59 [RFC 00/10] perf pollfd series v2 Arnaldo Carvalho de Melo
2014-09-03 21:59 ` [PATCH 01/10] perf evlist: Introduce perf_evlist__filter_pollfd method Arnaldo Carvalho de Melo
2014-09-03 21:59 ` [PATCH 02/10] perf tests: Add test for perf_evlist__filter_pollfd() Arnaldo Carvalho de Melo
2014-09-03 21:59 ` [PATCH 03/10] perf evlist: Monitor POLLERR and POLLHUP events too Arnaldo Carvalho de Melo
2014-09-03 21:59 ` [PATCH 04/10] perf record: Filter out POLLHUP'ed file descriptors Arnaldo Carvalho de Melo
2014-09-04 12:32   ` Adrian Hunter
2014-09-04 15:19     ` Arnaldo Carvalho de Melo
2014-09-05  8:42       ` Adrian Hunter
2014-09-05 14:07         ` Arnaldo Carvalho de Melo
2014-09-06 20:39           ` Jiri Olsa
2014-09-08 13:46             ` Arnaldo Carvalho de Melo [this message]
2014-09-08 14:04               ` Jiri Olsa
2014-09-08 14:33                 ` Arnaldo Carvalho de Melo
2014-09-08 15:10                   ` Jiri Olsa
2014-09-08 15:38                     ` Arnaldo Carvalho de Melo
2014-09-08 17:07                       ` Arnaldo Carvalho de Melo
2014-09-26  9:21                       ` [tip:perf/core] perf evlist: Refcount mmaps tip-bot for Arnaldo Carvalho de Melo
2014-09-26  9:20                     ` [tip:perf/core] perf evlist: We need to poll all event file descriptors tip-bot for Arnaldo Carvalho de Melo
2014-09-03 21:59 ` [PATCH 05/10] perf trace: Filter out POLLHUP'ed " Arnaldo Carvalho de Melo
2014-09-03 22:00 ` [PATCH 06/10] perf evlist: Allow growing pollfd on add method Arnaldo Carvalho de Melo
2014-09-03 22:00 ` [PATCH 07/10] perf tests: Add pollfd growing test Arnaldo Carvalho de Melo
2014-09-03 22:00 ` [PATCH 08/10] perf kvm stat live: Use perf_evlist__add_pollfd() instead of local equivalent Arnaldo Carvalho de Melo
2014-09-03 22:00 ` [PATCH 09/10] perf evlist: Introduce poll method for common code idiom Arnaldo Carvalho de Melo
2014-09-03 22:00 ` [PATCH 10/10] tools lib api: Adopt fdarray class from perf's evlist Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2014-08-22 20:59 [RFC 00/10] perf pollfd series Arnaldo Carvalho de Melo
2014-08-22 20:59 ` [PATCH 04/10] perf record: Filter out POLLHUP'ed file descriptors Arnaldo Carvalho de Melo

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=20140908134615.GD2773@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --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;
as well as URLs for NNTP newsgroup(s).