mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karl Mehltretter <kmehltretter@gmail.com>
To: Hongyan Xia <hongyan.xia@transsion.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>, Song Liu <song@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	 Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	 Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Valentin Schneider <vschneid@redhat.com>,
	 "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	 "linux-trace-kernel@vger.kernel.org"
	<linux-trace-kernel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] sched/preempt: Check preempt counts in notrace helpers
Date: Wed, 25 Nov 2026 20:23:30 +0100	[thread overview]
Message-ID: <awcwI1imHpWk8QFE@gmail.com> (raw)
In-Reply-To: <c9b1e3a8-bb25-4808-bcf0-f2d5ba72a58f@transsion.com>

On Wed, Nov 25, 2026 at 01:26:28PM +0100, Hongyan Xia wrote:
> > CONFIG_DEBUG_PREEMPT enabled. They therefore skip the bounds checks
> > which ordinary preemption operations provide.
> 
> Nit: Somehow my brain cannot parse 'bounds checks' before reading the 
> whole patch. Hopefully it's just me.

I'll reword that to 'underflow and near-overflow checks'.

> >   #define preempt_check_resched() do { } while (0)
> 
> No need for this hunk as you are in !CONFIG_PREEMPTION without any 
> checks anyway, but for symmetry I guess it doesn't hurt.
> 
> But if you decide to keep this change, then we can always use your new 
> macros and remove __preempt_count_{inc/dec}(). They no longer have any 
> users anyway?

Agreed, I'll remove those two macros.

> > +CFLAGS_core.o += -DDISABLE_BRANCH_PROFILING
> > +endif
> >   CFLAGS_build_policy.o += -DDISABLE_BRANCH_PROFILING
> >   CFLAGS_build_utility.o += -DDISABLE_BRANCH_PROFILING
> >   endif
> 
> This exclusion looks massive for a whole core.c file. When someone 
> profiles branches, does he or she really care about branch statistics in 
> DEBUG_LOCKS_WARN_ON()? Can we just switch to unlikely_notrace() in that 
> macro globally?

unlikely_notrace() does not solve the PROFILE_ALL_BRANCHES case, which
instruments if statements directly, including those in the notrace
helpers.

I will follow Steven's suggestion and make the Branch Profiling choice
depend on !DEBUG_PREEMPT instead.

Thanks,
Karl

      reply	other threads:[~2026-11-25 19:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  7:54 [PATCH 0/3] sched/preempt: Check notrace preempt-count updates Karl Mehltretter
2026-11-16  7:54 ` [PATCH 1/3] arm64: Always inline raw preempt count updates Karl Mehltretter
2026-11-25 11:59   ` Hongyan Xia
2026-11-16  7:54 ` [PATCH 2/3] arm64: Always inline preempt count and reschedule checks Karl Mehltretter
2026-11-25 12:00   ` Hongyan Xia
2026-11-16  7:54 ` [PATCH 3/3] sched/preempt: Check preempt counts in notrace helpers Karl Mehltretter
2026-11-24 16:08   ` Steven Rostedt
2026-11-25 13:26   ` Hongyan Xia
2026-11-25 19:23     ` Karl Mehltretter [this message]

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=awcwI1imHpWk8QFE@gmail.com \
    --to=kmehltretter@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hongyan.xia@transsion.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=will@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

all inboxes | Powered by JetHome®