|
@@ -5128,25 +5128,48 @@ out_irq:
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(yield_to);
|
|
EXPORT_SYMBOL_GPL(yield_to);
|
|
|
|
|
|
|
|
+int io_schedule_prepare(void)
|
|
|
|
+{
|
|
|
|
+ int old_iowait = current->in_iowait;
|
|
|
|
+
|
|
|
|
+ current->in_iowait = 1;
|
|
|
|
+ blk_schedule_flush_plug(current);
|
|
|
|
+
|
|
|
|
+ return old_iowait;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void io_schedule_finish(int token)
|
|
|
|
+{
|
|
|
|
+ current->in_iowait = token;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* This task is about to go to sleep on IO. Increment rq->nr_iowait so
|
|
* This task is about to go to sleep on IO. Increment rq->nr_iowait so
|
|
* that process accounting knows that this is a task in IO wait state.
|
|
* that process accounting knows that this is a task in IO wait state.
|
|
*/
|
|
*/
|
|
long __sched io_schedule_timeout(long timeout)
|
|
long __sched io_schedule_timeout(long timeout)
|
|
{
|
|
{
|
|
- int old_iowait = current->in_iowait;
|
|
|
|
|
|
+ int token;
|
|
long ret;
|
|
long ret;
|
|
|
|
|
|
- current->in_iowait = 1;
|
|
|
|
- blk_schedule_flush_plug(current);
|
|
|
|
-
|
|
|
|
|
|
+ token = io_schedule_prepare();
|
|
ret = schedule_timeout(timeout);
|
|
ret = schedule_timeout(timeout);
|
|
- current->in_iowait = old_iowait;
|
|
|
|
|
|
+ io_schedule_finish(token);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(io_schedule_timeout);
|
|
EXPORT_SYMBOL(io_schedule_timeout);
|
|
|
|
|
|
|
|
+void io_schedule(void)
|
|
|
|
+{
|
|
|
|
+ int token;
|
|
|
|
+
|
|
|
|
+ token = io_schedule_prepare();
|
|
|
|
+ schedule();
|
|
|
|
+ io_schedule_finish(token);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(io_schedule);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* sys_sched_get_priority_max - return maximum RT priority.
|
|
* sys_sched_get_priority_max - return maximum RT priority.
|
|
* @policy: scheduling class.
|
|
* @policy: scheduling class.
|