public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	mathieu.desnoyers@efficios.com,
	Mark Rutland <mark.rutland@arm.com>,
	cmarinas@kernel.org, maddy@linux.ibm.com, ryan.roberts@arm.com,
	Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: Re: [RFC] in-kernel rseq
Date: Fri, 17 Apr 2026 14:59:31 +0530	[thread overview]
Message-ID: <07956a80-2e1d-4b89-9b94-52b5fd500ff6@linux.ibm.com> (raw)
In-Reply-To: <20260415085131.10321Abf-hca@linux.ibm.com>

Hi Heiko.

On 4/15/26 2:21 PM, Heiko Carstens wrote:
> On Fri, Apr 10, 2026 at 11:27:50PM +0530, Shrikanth Hegde wrote:
>> Hi Peter,
>>
>> On 2/23/26 10:08 PM, Peter Zijlstra wrote:
>>> Hi,
>>>
>>> It has come to my attention that various people are struggling with
>>> preempt_disable()+preempt_enable() costs for various architectures.
>>>
>>> Mostly in relation to things like this_cpu_ and or local_.
>>>
>>> The below is a very crude (and broken, more on that below) POC.
>>>
>>> So the 'main' advantage of this over preempt_disable()/preempt_enable(),
>>> it on the preempt_enable() side, this elides the whole conditional and
>>> call schedule() nonsense.
>>
>> This might be a very stupid question.
>>
>> Why not just call preempt_enable_no_resched instead?
>>
>> this_cpu operations would have disabled preemption so the per_cpu
>> structures are protected from thread migration right? intention
>> here is likely not to call schedule. No?
> 
> Doing that would make it unpredictable when the kernel is preempted for
> cases where TIF_PREEMPT is set while within a code section which has
> preemption disabled and where preemption is enabled again without checking
> for TIF_PREEMPT.


Ok. I discussed this with peter too. Likely we need to do something using paca.
I will go through your implementation.

While there, maybe move preempt count to paca too which has been long pending.
atleast for ppc64.

  reply	other threads:[~2026-04-17  9:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 16:38 [RFC] in-kernel rseq Peter Zijlstra
2026-02-23 17:53 ` David Laight
2026-02-23 18:22   ` Mathieu Desnoyers
2026-02-23 21:54     ` Peter Zijlstra
2026-02-24 10:27       ` David Laight
2026-02-24 13:33         ` Mathieu Desnoyers
2026-02-24 14:49           ` David Laight
2026-02-24 16:15             ` Mathieu Desnoyers
2026-02-24 11:16 ` Heiko Carstens
2026-02-24 13:48   ` Mathieu Desnoyers
2026-02-24 14:59     ` David Laight
2026-02-24 16:18       ` Mathieu Desnoyers
2026-02-24 15:17   ` Peter Zijlstra
2026-02-24 15:20   ` Peter Zijlstra
2026-02-24 16:02     ` Heiko Carstens
2026-02-24 16:15       ` Heiko Carstens
2026-04-10 17:57 ` Shrikanth Hegde
2026-04-15  8:51   ` Heiko Carstens
2026-04-17  9:29     ` Shrikanth Hegde [this message]
2026-04-17  9:36     ` Shrikanth Hegde

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=07956a80-2e1d-4b89-9b94-52b5fd500ff6@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=cmarinas@kernel.org \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=peterz@infradead.org \
    --cc=ryan.roberts@arm.com \
    --cc=tglx@linutronix.de \
    /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