目前内核(4.12)栈的大小是16K

liclude/linux/sched.h

union thread_union {
#ifndef CONFIG_THREAD_INFO_IN_TASK
    struct thread_info thread_info;
#endif
    unsigned long stack[THREAD_SIZE/sizeof(long)];
};

#define THREAD_SIZE        16384

可以看到栈大小被写死16K,且没有参数可以调整除非改源码


通过echo 1 > /proc/sys/kernel/stack_tracer_enabled 是能内核栈的检测

其中stack_max_size 表示内核栈使用的峰值。stack_trace 表示此峰值下的callstack和callstack中个个函数使用的栈的大小

kernel内核栈的检测

相关文章:

  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-06-19
  • 2021-09-07
  • 2021-06-09
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案