fix(os): fix kstack leak issues

The kstack_id is not recycled when KernelStack is dropped, which leads to kstack
leak issue. Ch8 branch, and branches after that, are also affected by this
issue.

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
This commit is contained in:
Xuewei Niu 2022-10-19 17:25:09 +08:00
parent d0daf8f4a4
commit d7ccea8f18

View File

@ -87,6 +87,7 @@ impl Drop for KernelStack {
KERNEL_SPACE
.exclusive_access()
.remove_area_with_start_vpn(kernel_stack_bottom_va.into());
KSTACK_ALLOCATOR.exclusive_access().dealloc(self.0);
}
}