Re: [PATCH v1 0/4] Fix ftrace and kprobes issues for LoongArch
From: Huacai Chen
Date: Thu May 21 2026 - 22:41:19 EST
On Fri, May 22, 2026 at 10:17 AM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
> On 2026/5/21 下午8:52, Huacai Chen wrote:
> > On Thu, May 21, 2026 at 10:37 AM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
> ...
>
> > OK, but I want to remove preempt_enable_no_resched() in Patch#4
> > because all other architectures have no.
>
> As the commit message said, this is to balance the preemption count.
>
> We don't want to be preempted for the entire duration of kprobe
> processing, preempt_disable() is called at the start of
> kprobe_breakpoint_handler(), so preempt_enable_no_resched()
> should also be called at each exit path.
You are entering the panic path, who cares about preemption at this
point? On the other hand, keeping preemption disabled is better,
because nobody wants the "last state" to be corrupted by preemption.
Huacai
>
> So, it should keep the code as is.
>
> Thanks,
> Tiezhu
>