All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	mingo@kernel.org, peterz@infradead.org,
	linux-kernel@vger.kernel.org
Cc: acme@kernel.org, mark.rutland@arm.com, jolsa@redhat.com,
	namhyung@kernel.org, andi@firstfloor.org,
	kan.liang@linux.intel.com, alexander.shishkin@linux.intel.com
Subject: Re: [PATCH 1/3] perf: Optimize perf_install_in_event()
Date: Wed, 23 Oct 2019 15:30:27 +0300	[thread overview]
Message-ID: <874kzz4pb0.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20191022092307.368892814@infradead.org>

Peter Zijlstra <peterz@infradead.org> writes:

> +	/*
> +	 * perf_event_attr::disabled events will not run and can be initialized
> +	 * without IPI. Except when this is the first event for the context, in
> +	 * that case we need the magic of the IPI to set ctx->is_active.
> +	 *
> +	 * The IOC_ENABLE that is sure to follow the creation of a disabled
> +	 * event will issue the IPI and reprogram the hardware.
> +	 */
> +	if (__perf_effective_state(event) == PERF_EVENT_STATE_OFF && ctx->nr_events) {
> +		raw_spin_lock_irq(&ctx->lock);
> +		if (task && ctx->task == TASK_TOMBSTONE) {

Confused: isn't that redundant? If ctx->task reads TASK_TOMBSTONE, task
is always !NULL, afaict. And in any case, if a task context is going
away, we shouldn't probably be adding events there. Or am I missing
something?

Other than that, this makes sense to me, fwiw.

Regards,
--
Alex

  parent reply	other threads:[~2019-10-23 12:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  9:20 [PATCH 0/3] Various optimizations for event creation Peter Zijlstra
2019-10-22  9:20 ` [PATCH 1/3] perf: Optimize perf_install_in_event() Peter Zijlstra
2019-10-22 10:03   ` Peter Zijlstra
2019-10-23 12:30   ` Alexander Shishkin [this message]
2019-10-23 13:44     ` Peter Zijlstra
2019-10-23 14:08       ` Peter Zijlstra
2019-10-22  9:20 ` [PATCH 2/3] perf: Optimize perf_init_event() Peter Zijlstra
2019-10-27  5:18   ` [perf] 06e0dbcfd3: phoronix-test-suite.mbw.0.mib_s 12.6% improvement kernel test robot
2019-10-27  5:18     ` kernel test robot
2019-10-27 16:32     ` Andi Kleen
2019-10-22  9:20 ` [PATCH 3/3] perf: Optimize perf_init_event() for TYPE_SOFTWARE Peter Zijlstra

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=874kzz4pb0.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.