Fix delay()
Somewhat amazingly it went unnoticed that the delay() function doesn't actually cause the task to block. Since the task state is never changed from TASK_RUNNING before schedule_timeout() the scheduler allows to task to continue running without any delay. Using schedule_timeout_interruptible() resolves the issue by correctly setting TASK_UNINTERRUPTIBLE. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
f6437b60c2
commit
ab59be7bc7
|
@ -35,7 +35,7 @@
|
||||||
#define ddi_get_lbolt() ((clock_t)jiffies)
|
#define ddi_get_lbolt() ((clock_t)jiffies)
|
||||||
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
|
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
|
||||||
|
|
||||||
#define delay(ticks) schedule_timeout((long)(ticks))
|
#define delay(ticks) schedule_timeout_uninterruptible(ticks)
|
||||||
|
|
||||||
#define SEC_TO_TICK(sec) ((sec) * HZ)
|
#define SEC_TO_TICK(sec) ((sec) * HZ)
|
||||||
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
|
#define MSEC_TO_TICK(ms) msecs_to_jiffies(ms)
|
||||||
|
|
Loading…
Reference in New Issue