Re: [PATCH next v1 1/2] dump_stack: move cpu lock to printk.c

From: Sergey Senozhatsky
Date: Mon May 31 2021 - 22:55:30 EST


On (21/05/31 18:20), John Ogness wrote:
> +void printk_cpu_lock(unsigned int *cpu_store, unsigned long *flags)
> +{
> + unsigned int cpu;
> +
> + for (;;) {
> + cpu = get_cpu();
> +
> + *cpu_store = atomic_read(&printk_cpulock_owner);
> +
> + if (*cpu_store == -1) {
> + local_irq_save(*flags);

Is there any particular reason this does

preempt_disable();
cpu = smp_processor_id();
local_irq_safe();

instead of

local_irq_safe();
cpu = raw_smp_processor_id();

?