Skip to content

feat(watchdog): Add Softlockup Detection.#30

Draft
WEIXIAOYVYI wants to merge 10 commits intoStarry-OS:devfrom
WEIXIAOYVYI:softlockup
Draft

feat(watchdog): Add Softlockup Detection.#30
WEIXIAOYVYI wants to merge 10 commits intoStarry-OS:devfrom
WEIXIAOYVYI:softlockup

Conversation

@WEIXIAOYVYI
Copy link

No description provided.

AsakuraMizu and others added 10 commits December 8, 2025 17:18
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>
}
});
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I supoose that this section code should put in axwatchdog::install_softlockup_timer

}
});
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check last comments

.lock()
.iter()
{
if let Some(task) = weaktask.upgrade() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???? 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")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unnecessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants