mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: 石祤 <linxiulei@gmail.com>
Cc: yang_oliver@hotmail.com, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, eranian@gmail.com,
	torvalds@linux-foundation.org, jolsa@redhat.com,
	"leilei.lin" <leilei.lin@alibaba-inc.com>
Subject: Re: [PATCH v3] perf/core: Avoid context switch overheads
Date: Wed, 9 Aug 2017 18:37:22 +0200	[thread overview]
Message-ID: <20170809163722.7555bmpxukvejdkp@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20170809002921.69813-1-leilei.lin@alibaba-inc.com>

On Wed, Aug 09, 2017 at 08:29:21AM +0800, 石祤 wrote:
> From: "leilei.lin" <leilei.lin@alibaba-inc.com>
> 
> A performance issue caused by less strickly check in task
> sched when these tasks were once attached by per-task perf_event.
> 
> A task will alloc task->perf_event_ctxp[ctxn] when it was called
> by perf_event_open, and task->perf_event_ctxp[ctxn] would not
> ever be freed to NULL.
> 
> __perf_event_task_sched_in()
>         if (task->perf_event_ctxp[ctxn]) //  here is always true
>                 perf_event_context_sched_in() // operate pmu
> 
> 50% at most performance overhead was observed under some extreme
> test case. Therefore, add a more strick check as to ctx->nr_events,
> when ctx->nr_events == 0, it's no need to continue.
> 
> Signed-off-by: leilei.lin <leilei.lin@alibaba-inc.com>

Thanks!

  reply	other threads:[~2017-08-09 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  0:29 石祤
2017-08-09 16:37 ` Peter Zijlstra [this message]
2017-08-10 12:03 ` [tip:perf/core] perf/core: Reduce context switch overhead tip-bot for leilei.lin
2017-08-09  0:40 [PATCH v3] perf/core: Avoid context switch overheads linxiulei

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=20170809163722.7555bmpxukvejdkp@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=leilei.lin@alibaba-inc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linxiulei@gmail.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yang_oliver@hotmail.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

all inboxes | Powered by JetHome®