public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Song Liu <songliubraving@fb.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"maddy@linux.vnet.ibm.com" <maddy@linux.vnet.ibm.com>,
	"kjain@linux.ibm.com" <kjain@linux.ibm.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"eranian@google.com" <eranian@google.com>
Subject: Re: [V2] perf/core: Avoid calling perf_mux_hrtimer_restart multiple times when scheduling event groups
Date: Mon, 18 Oct 2021 13:07:54 +0200	[thread overview]
Message-ID: <YW1ViqOYaVi8NnqE@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <6E561141-B584-4DB8-A33E-BCD3FF572FA4@fb.com>

On Sat, Oct 16, 2021 at 01:08:04AM +0000, Song Liu wrote:
> 
> 
> > On Oct 15, 2021, at 12:04 AM, Athira Rajeev <atrajeev@linux.vnet.ibm.com> wrote:
> > 
> > Perf uses multiplexing if there are more events to be scheduled than the
> > available counters. With multiplexing, event groups will be rotated at
> > specified interval of time which is set using "hrtimer". During event
> > scheduling, if any of the event group fails to schedule, multiplexing
> > gets enabled by setting "rotate_necessary" for that event context and
> > starting the hrtimer by calling "perf_mux_hrtimer_restart".
> > 
> > Patch adds an optimisation to avoid calling "perf_mux_hrtimer_restart"
> > multiple times if already rotate_necessary is set for that context.
> > Even though "perf_mux_hrtimer_restart" will just return if hrtimer is
> > already active, this could avoid the overhead of calling this function
> > multiple times if there are many event groups. Patch adds the check to
> > avoid calling perf_mux_hrtimer_restart() for each event group on
> > every schedule.
> > 
> > Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> 
> Acked-by: Song Liu <song@kernel.org>

Thanks!

  reply	other threads:[~2021-10-18 11:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  7:04 [V2] perf/core: Avoid calling perf_mux_hrtimer_restart multiple times when scheduling event groups Athira Rajeev
2021-10-16  1:08 ` Song Liu
2021-10-18 11:07   ` Peter Zijlstra [this message]
2021-10-21 12:22     ` Athira Rajeev

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=YW1ViqOYaVi8NnqE@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mingo@redhat.com \
    --cc=songliubraving@fb.com \
    /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