瀏覽代碼

fix: disable mm debug log to prevent system lockup due to thingbuf issue (#808)

LoGin 11 月之前
父節點
當前提交
352ee04918
共有 3 個文件被更改,包括 13 次插入17 次删除
  1. 11 16
      kernel/src/debug/klog/mm.rs
  2. 1 0
      kernel/src/process/mod.rs
  3. 1 1
      user/dadk/config/held-0.1.0.dadk

+ 11 - 16
kernel/src/debug/klog/mm.rs

@@ -1,17 +1,10 @@
 extern crate klog_types;
 
-use core::{
-    intrinsics::unlikely,
-    sync::atomic::{compiler_fence, Ordering},
-};
+use core::sync::atomic::{compiler_fence, Ordering};
 
 use klog_types::{AllocatorLog, AllocatorLogType, LogSource, MMLogChannel};
 
-use crate::{
-    arch::CurrentTimeArch,
-    process::{Pid, ProcessManager},
-    time::TimeArch,
-};
+use crate::{arch::CurrentTimeArch, process::Pid, time::TimeArch};
 
 /// 全局的内存分配器日志通道
 ///
@@ -31,13 +24,14 @@ static __MM_DEBUG_LOG_IDA: ida::IdAllocator = ida::IdAllocator::new(1, usize::MA
 ///
 /// - `log_type`:日志类型
 /// - `source`:日志来源
-pub fn mm_debug_log(log_type: AllocatorLogType, source: LogSource) {
-    let pid = if unlikely(!ProcessManager::initialized()) {
-        Some(Pid::new(0))
-    } else {
-        Some(ProcessManager::current_pcb().pid())
-    };
-    MMDebugLogManager::log(log_type, source, pid);
+pub fn mm_debug_log(_log_type: AllocatorLogType, _source: LogSource) {
+    // todo: 由于目前底层的thingbuf存在卡死的问题,因此这里暂时注释掉。
+    // let pid = if unlikely(!ProcessManager::initialized()) {
+    //     Some(Pid::new(0))
+    // } else {
+    //     Some(ProcessManager::current_pcb().pid())
+    // };
+    // MMDebugLogManager::log(log_type, source, pid);
 }
 
 #[derive(Debug)]
@@ -54,6 +48,7 @@ impl MMDebugLogManager {
     /// - `log_type`:日志类型
     /// - `source`:日志来源
     /// - `pid`:日志来源的pid
+    #[allow(dead_code)]
     pub fn log(log_type: AllocatorLogType, source: LogSource, pid: Option<Pid>) {
         let id = __MM_DEBUG_LOG_IDA.alloc().unwrap();
         let log = AllocatorLog::new(

+ 1 - 0
kernel/src/process/mod.rs

@@ -147,6 +147,7 @@ impl ProcessManager {
     }
 
     /// 判断进程管理器是否已经初始化完成
+    #[allow(dead_code)]
     pub fn initialized() -> bool {
         unsafe { __PROCESS_MANAGEMENT_INIT_DONE }
     }

+ 1 - 1
user/dadk/config/held-0.1.0.dadk

@@ -6,7 +6,7 @@
     "BuildFromSource": {
       "Git": {
         "url" : "https://git.mirrors.dragonos.org.cn/DragonOS-Community/Held.git",
-        "revision": "76304e995f"
+        "revision": "f192df4"
       }
     }
   },