mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Wander Lairson Costa <wander@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Boqun Feng <boqun.feng@gmail.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:TRACING" <linux-trace-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Clark Williams <williams@redhat.com>,
	Gabriele Monaco <gmonaco@redhat.com>
Subject: Re: [PATCH v3 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead
Date: Tue, 8 Jul 2025 20:46:56 +0200	[thread overview]
Message-ID: <20250708184656.GB477119@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <ppdduzdqnd3kwourcmocfi35i7wcbuagmzqgtgmyr55aps774t@37wucnoii7o3>

On Tue, Jul 08, 2025 at 10:09:45AM -0300, Wander Lairson Costa wrote:
> On Mon, Jul 07, 2025 at 01:26:22PM +0200, Peter Zijlstra wrote:
> > On Fri, Jul 04, 2025 at 02:07:43PM -0300, Wander Lairson Costa wrote:
> > > +#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE)
> > > +#define preempt_count_dec_and_test() \
> > > +	({ preempt_count_sub(1); should_resched(0); })
> > > +#endif
> > 
> > Also this is terrible. Surely you can do better.
> > 
> 
> Thank you for pointing this out. I'm not sure I've fully understood the
> concern here. My understanding was that this logic was pre-existing and
> my patch only reorganized it.
> 
> I'm clearly missing something. Could you please elaborate a bit on the
> issue you've spotted?

The normal (!DEBUG) case uses __preempt_count_dec_and_test(), which is
significantly better.

  reply	other threads:[~2025-07-08 18:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 17:07 [PATCH v3 0/2] tracing/preemptirq: Optimize disabled " Wander Lairson Costa
2025-07-04 17:07 ` [PATCH v3 1/2] trace/preemptirq: reduce overhead of irq_enable/disable tracepoints Wander Lairson Costa
2025-07-06  4:29   ` kernel test robot
2025-07-04 17:07 ` [PATCH v3 2/2] tracing/preemptirq: Optimize preempt_disable/enable() tracepoint overhead Wander Lairson Costa
2025-07-07 10:29   ` kernel test robot
2025-07-07 11:20   ` Peter Zijlstra
2025-07-08 12:54     ` Wander Lairson Costa
2025-07-08 18:54       ` Peter Zijlstra
2025-08-01 13:30         ` Wander Lairson Costa
2025-08-25 11:56           ` Wander Lairson Costa
2025-07-07 11:26   ` Peter Zijlstra
2025-07-08 13:09     ` Wander Lairson Costa
2025-07-08 18:46       ` Peter Zijlstra [this message]
2025-08-01 13:05         ` Wander Lairson Costa

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=20250708184656.GB477119@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dwmw@amazon.co.uk \
    --cc=gmonaco@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=wander@redhat.com \
    --cc=williams@redhat.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®