feat(watchdog): Add Softlockup Detection.#30
feat(watchdog): Add Softlockup Detection.#30WEIXIAOYVYI wants to merge 10 commits intoStarry-OS:devfrom
Conversation
Co-authored-by: 朝倉水希 <asakuramizu111@gmail.com>
Signed-off-by: Weikang Guo <guoweikang@kylinos.cn> Co-authored-by: Weikang Guo <guoweikang@kylinos.cn> Co-authored-by: zhangguoyu <zhangguoyu@kylinos.cn>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: 朝倉水希 <asakuramizu111@gmail.com>
Signed-off-by: luozhixian <luozhixian@kylinos.cn> # Conflicts: # Cargo.toml # modules/axruntime/Cargo.toml
Signed-off-by: luozhixian <luozhixian@kylinos.cn>
Signed-off-by: luozhixian <luozhixian@kylinos.cn>
| } | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
I supoose that this section code should put in axwatchdog::install_softlockup_timer ?
| } | ||
| }); | ||
| } | ||
|
|
| .lock() | ||
| .iter() | ||
| { | ||
| if let Some(task) = weaktask.upgrade() { |
There was a problem hiding this comment.
I think dump task backtrace is very important too, and we need to refer to other system's dump info content and format. and I also want to know: Don't we need to stopmachine when we dump system info?
| /// Stores all tasks for each CPU except those in the 'exited' state. | ||
| #[cfg(feature = "watchdog")] | ||
| static mut GLOBAL_TASK_QUEUES: [SpinNoIrq<Vec<WeakAxTaskRef>>; axconfig::plat::CPU_NUM] = | ||
| [const { SpinNoIrq::new(Vec::new()) }; axconfig::plat::CPU_NUM]; |
There was a problem hiding this comment.
why? why we need to store task in different CPU ? our task can be schedule in different cpu , don't they? I think we should store cpu id in task when thery are scheduled; and global tasks used to store all of create tasks!
| #[cfg(feature = "watchdog")] | ||
| get_global_task_queue(self.inner.cpu_id) | ||
| .lock() | ||
| .push(Arc::downgrade(&task)); |
There was a problem hiding this comment.
???? I think we need to add task to global when we created them, but not when we schedule them
| debug!("task exit: {}, exit_code={}", curr.id_name(), exit_code); | ||
| assert!(curr.is_running(), "task is not running: {:?}", curr.state()); | ||
| assert!(!curr.is_idle()); | ||
| #[cfg(feature = "watchdog")] |
There was a problem hiding this comment.
we should remove task when they are exit or dropped,
| watchdog_task.set_cpumask(AxCpuMask::one_shot(cpu_id)); | ||
| get_global_task_queue(cpu_id) | ||
| .lock() | ||
| .push(Arc::downgrade(&watchdog_task)); |
No description provided.