Re: [PATCH v2 3/5] powerpc: Use preemption model accessors
From: Valentin Schneider <hidden>
Date: 2021-11-22 16:44:43
Also in:
linux-kbuild, lkml
On 16/11/21 14:41, Christophe Leroy wrote:
Le 10/11/2021 à 21:24, Valentin Schneider a écrit :quoted
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead.Is that change worth it for now ? As far as I can see powerpc doesn't have DYNAMIC PREEMPT, a lot of work needs to be done before being able to use it: - Implement GENERIC_ENTRY - Implement STATIC_CALLS (already done on PPC32, to be done on PPC64)
You're right, I ditched this patch for v3 - AFAICT the change wasn't even valid as the preempt_schedule_irq() call needs to be replaced with irqentry_exit_cond_resched() (IOW this needs to make use of the generic entry code).
quoted
sched_init() -> preempt_dynamic_init() happens way before IRQs are set up, so this should be fine.It looks like you are mixing up interrupts and IRQs (also known as "external interrupts"). ISI (Instruction Storage Interrupt) and DSI (Data Storage Interrupt) for instance are also interrupts. They happen everytime there is a page fault so may happen pretty early. Traps generated by WARN_ON() are also interrupts that may happen at any time.
Michael pointed this out and indeed triggering a WARN_ON() there is not super smart. Thanks for teaching me a bit of what I'm putting my grubby hands in :)