Skip to content

Commit 352ee04

Browse files
authored
fix: disable mm debug log to prevent system lockup due to thingbuf issue (#808)
1 parent 37cef00 commit 352ee04

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

kernel/src/debug/klog/mm.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
extern crate klog_types;
22

3-
use core::{
4-
intrinsics::unlikely,
5-
sync::atomic::{compiler_fence, Ordering},
6-
};
3+
use core::sync::atomic::{compiler_fence, Ordering};
74

85
use klog_types::{AllocatorLog, AllocatorLogType, LogSource, MMLogChannel};
96

10-
use crate::{
11-
arch::CurrentTimeArch,
12-
process::{Pid, ProcessManager},
13-
time::TimeArch,
14-
};
7+
use crate::{arch::CurrentTimeArch, process::Pid, time::TimeArch};
158

169
/// 全局的内存分配器日志通道
1710
///
@@ -31,13 +24,14 @@ static __MM_DEBUG_LOG_IDA: ida::IdAllocator = ida::IdAllocator::new(1, usize::MA
3124
///
3225
/// - `log_type`:日志类型
3326
/// - `source`:日志来源
34-
pub fn mm_debug_log(log_type: AllocatorLogType, source: LogSource) {
35-
let pid = if unlikely(!ProcessManager::initialized()) {
36-
Some(Pid::new(0))
37-
} else {
38-
Some(ProcessManager::current_pcb().pid())
39-
};
40-
MMDebugLogManager::log(log_type, source, pid);
27+
pub fn mm_debug_log(_log_type: AllocatorLogType, _source: LogSource) {
28+
// todo: 由于目前底层的thingbuf存在卡死的问题,因此这里暂时注释掉。
29+
// let pid = if unlikely(!ProcessManager::initialized()) {
30+
// Some(Pid::new(0))
31+
// } else {
32+
// Some(ProcessManager::current_pcb().pid())
33+
// };
34+
// MMDebugLogManager::log(log_type, source, pid);
4135
}
4236

4337
#[derive(Debug)]
@@ -54,6 +48,7 @@ impl MMDebugLogManager {
5448
/// - `log_type`:日志类型
5549
/// - `source`:日志来源
5650
/// - `pid`:日志来源的pid
51+
#[allow(dead_code)]
5752
pub fn log(log_type: AllocatorLogType, source: LogSource, pid: Option<Pid>) {
5853
let id = __MM_DEBUG_LOG_IDA.alloc().unwrap();
5954
let log = AllocatorLog::new(

kernel/src/process/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl ProcessManager {
147147
}
148148

149149
/// 判断进程管理器是否已经初始化完成
150+
#[allow(dead_code)]
150151
pub fn initialized() -> bool {
151152
unsafe { __PROCESS_MANAGEMENT_INIT_DONE }
152153
}

user/dadk/config/held-0.1.0.dadk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"BuildFromSource": {
77
"Git": {
88
"url" : "https://git.mirrors.dragonos.org.cn/DragonOS-Community/Held.git",
9-
"revision": "76304e995f"
9+
"revision": "f192df4"
1010
}
1111
}
1212
},

0 commit comments

Comments
 (0)