Re: [POC 1/6] irq & spin_lock: Add counted interrupt disabling/enabling
From: Peter Zijlstra
Date: Fri Oct 25 2024 - 14:30:33 EST
On Fri, Oct 25, 2024 at 05:04:15PM +0200, Thomas Gleixner wrote:
> On Thu, Oct 24 2024 at 14:57, Boqun Feng wrote:
> > On Thu, Oct 24, 2024 at 07:22:19PM +0200, Thomas Gleixner wrote:
> >> On Thu, Oct 24 2024 at 12:05, Peter Zijlstra wrote:
> >> > That is my only concern -- making insane code crash hard is good, making
> >> > it silently mostly work but cause random weirdness is not.
> >>
> >> I wish we could come up with a lightweight check for that.
> >>
> > Since the preempt part takes exactly one byte in the preempt counter,
> > maybe we could use a "incb + jo"?
probably something like:
incb
jno 1f
ud2
1:
is best, something about forward branches being preferred or somesuch.
Anyway, if we want to use the same thing for the interrupt disable
depth, we need another byte, meaning we need to compress the
NEED_RESCHED, NMI and HARDIRQ masks into a single byte.
Might just be possible I suppose.