mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Kan Liang <kan.liang@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf cgroups: Don't rotate events for cgroups unnecessarily
Date: Mon, 24 Jun 2019 09:55:20 +0200	[thread overview]
Message-ID: <20190624075520.GC3436@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAP-5=fW7sMjQEHm+1e=cdAi+ZyP53UyU7xhAbnouMApuxYqrhw@mail.gmail.com>

On Fri, Jun 21, 2019 at 11:01:29AM -0700, Ian Rogers wrote:
> On Fri, Jun 21, 2019 at 1:24 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Sat, Jun 01, 2019 at 01:27:22AM -0700, Ian Rogers wrote:
> > > @@ -3325,6 +3331,15 @@ static int flexible_sched_in(struct perf_event *event, void *data)
> > >                       sid->can_add_hw = 0;
> > >       }
> > >
> > > +     /*
> > > +      * If the group wasn't scheduled then set that multiplexing is necessary
> > > +      * for the context. Note, this won't be set if the event wasn't
> > > +      * scheduled due to event_filter_match failing due to the earlier
> > > +      * return.
> > > +      */
> > > +     if (event->state == PERF_EVENT_STATE_INACTIVE)
> > > +             sid->ctx->rotate_necessary = 1;
> > > +
> > >       return 0;
> > >  }
> >
> > That looked odd; which had me look harder at this function which
> > resulted in the below. Should we not terminate the context interation
> > the moment one flexible thingy fails to schedule?
> 
> If we knew all the events were hardware events then this would be
> true, as there may be software events that always schedule then the
> continued iteration is necessary.

But this is the 'old' code, where this is guaranteed by the context.
That is, if this is a hardware context; there wil only be software
events due to them being in a group with hardware events.

If this is a software group, then we'll never fail to schedule and we'll
not get in this branch to begin with.

Or am I now confused for having been staring at two different code-bases
at the same time?

  reply	other threads:[~2019-06-24  7:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-01  8:27 Ian Rogers
2019-06-13 16:12 ` Liang, Kan
2019-06-14 19:10   ` Stephane Eranian
2019-06-14 21:43     ` Liang, Kan
2019-06-20 23:08       ` Ian Rogers
2019-06-21  8:24 ` Peter Zijlstra
2019-06-21 18:01   ` Ian Rogers
2019-06-24  7:55     ` Peter Zijlstra [this message]
2019-06-27 21:47       ` Ian Rogers
2019-08-23 10:43         ` Ganapatrao Kulkarni
2019-08-23 11:59           ` Peter Zijlstra
2019-08-23 12:56             ` Ganapatrao Kulkarni
2019-08-23 13:03               ` Peter Zijlstra
2019-09-18  7:21                 ` Ganapatrao Kulkarni
2019-10-15  4:43                   ` Ganapatrao Kulkarni
2019-06-25  8:43 ` [tip:perf/core] perf/cgroups: " tip-bot for Ian Rogers

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=20190624075520.GC3436@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.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

Powered by JetHome