Re: [PATCH v2] LoongArch: Fix preemptible warnings in cacheinfo and local TLB flush

From: Huacai Chen

Date: Thu Nov 19 2026 - 07:09:09 EST


On Thu, Nov 19, 2026 at 3:46 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
> On 11/19/26 2:09 PM, Tiezhu Yang wrote:
> > On 11/19/26 2:05 PM, Tiezhu Yang wrote:
> >> When CONFIG_DEBUG_PREEMPT is enabled on a Non-SMP kernel, calls to
> >> smp_processor_id() (including via current_cpu_data) in preemptible
> >> contexts trigger many "BUG: using smp_processor_id() in preemptible"
> >> warnings during cacheinfo setup and local TLB flushes.
>
> ...
>
> > After switching back to get_cpu() / put_cpu() (as in v1), this ASID
> > race completely disappears under the exact same test.
> >
> > So I think we should keep get_cpu() / put_cpu() in
> > local_flush_tlb_{mm,range,page}() (as in v1) to ensure preemption
> > safety, especially for UP preemptible kernels.
>
> If you are OK with the above analysis, I will send v3 (same to the
> code changes in v1, but need to update the commit message).
OK, please send V3, but I prefer the subject:
LoongArch: Fix preemptible warnings from smp_processor_id()

Huacai

>
> Thanks,
> Tiezhu
>
>