Bug 11627 - [devel-6.6] x86/mce: Avoid triggering a schedule call in the NMI context.
Summary: [devel-6.6] x86/mce: Avoid triggering a schedule call in the NMI context.
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Guanjun
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-04 11:08 UTC by LeoLiu-oc
Modified: 2024-11-04 11:13 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LeoLiu-oc zhaoxin_group 2024-11-04 11:08:51 UTC
In the original patch solution, when a UCR-type DRAM error occurs, the flow does not enter do_machine_check->mce_panic; instead, it exits after executing do_machine_check and continues with the irqentry_exit_to_user_mode function. This flow triggers a schedule call.
Since irqentry_nmi_enter calls __preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET), if a schedule occurs without executing irqentry_nmi_exit, the system will call the preempt_disable() function. Then, __schedule will call schedule_debug or determine in_atomic_preempt_off() to be true, leading to __schedule_bug and reporting the following error:
BUG: scheduling while atomic:……
Therefore, it is necessary to adjust the position of irqentry_nmi_enter.
Comment 1 小龙 admin 2024-11-04 11:13:59 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/4064