0
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/semaphore.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("preempt_count: %d\n", preempt_count());
preempt_disable();
printk("preempt_count: %d\n", preempt_count());
preempt_enable();
return 0;
}
void cleanup_module(void)
{
printk("cleanup_module\n");
}
上面的代碼打印以下信息到/ var/log/syslog的:爲什麼不preempt_disable增加preempt_count返回的值?
Sep 13 16:31:29 userver kernel: [ 600.835013] preempt_count: 0
Sep 13 16:31:29 userver kernel: [ 600.835017] preempt_count: 0
爲什麼preempt_disable後preempt_count仍返回0?