简体   繁体   English

Linux内核线程问题

[英]Linux Kernel Threads Issue

How to clear the memory used by the kernel threads. 如何清除内核线程使用的内存。

I have used kthread_run() multiple times (example around 300000 times), and do_exit() from the thread function. 我已经多次使用kthread_run()(例如约300000次),并从线程函数中使用过do_exit()。

Memory increases for every kthread_run(), is it a correct way to call kthread_run() multiple times? 每个kthread_run()的内存都会增加,这是多次调用kthread_run()的正确方法吗?

The requirement is that, I need to call the thread function, for every xxx time and do the cleanup. 要求是,我需要每隔xxx次调用一次线程函数并进行清理。

Any inputs will be highly appreciated. 任何输入将不胜感激。

Regards, Srinivasa Raghavan. 问候,Srinivasa Raghavan。

I found the answer by clearing the cache memory from the command prompt by the following command. 我通过以下命令从命令提示符处清除缓存来找到答案。

sync; 同步; echo 1 /proc/sys/vm/drop_caches 回声1 / proc / sys / vm / drop_caches

Thanks !!! 谢谢 !!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM