Re: [PATCH v1 0/4] Fix ftrace and kprobes issues for LoongArch

From: Tiezhu Yang

Date: Thu May 21 2026 - 23:05:42 EST


On 2026/5/22 上午10:40, Huacai Chen wrote:
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.

If you look at it from this angle, no objection from me.

If there are no objections from the other people, you can
remove the code and the description in the commit message.

"2. Balancing the preemption count with preempt_enable_no_resched() to
maintain preemption balance before the system halts."

Thanks,
Tiezhu