那些可进入睡眠状态的Linux内核函数
在linux内核开发中断处理函数不能调用可能导致睡眠的函数,下面总结linux内核可能引起睡眠的函数如下: schedule函数 schedule_timeout schedule_timeout_uninterruptible schedule_timeout_interruptible cond_resched might_resched sleep函数 msleep msleep_interruputible ssleep osal_usleep might_sleep 取信号量函数 down down_timeout down_read down_write down_interruptible wait_for_completion wait_for_completion_interruptible wait_for_completion_timeout wait_for_completion_interruptible_timeout kmalloc相关函数含有标志GFP_KERNEL kmalloc kzalloc krealloc kmem_cache_create kmem_cache_alloc kmem_cache_zalloc 取睡眠锁函数 mutex_lock mutex_lock_timeout mutex_lock_nested mutex_lock_interruptible mutex_lock_interruptible_nested 在中断处理函数不能使用睡眠函数原因 主要原因如下: ...