writeback: account IO throttling wait as iowait
authorWu Fengguang <fengguang.wu@intel.com>
Fri, 9 Oct 2009 10:40:42 +0000 (12:40 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 9 Oct 2009 10:40:42 +0000 (12:40 +0200)
It makes sense to do IOWAIT when someone is blocked
due to IO throttle, as suggested by Kame and Peter.

There is an old comment for not doing IOWAIT on throttle,
however it has been mismatching the code for a long time.

If we stop accounting IOWAIT for 2.6.32, it could be an
undesirable behavior change. So restore the io_schedule.

CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
kernel/sched.c
mm/page-writeback.c

index 1535f3884b88ebd7c33bff7c0e5970a96980a29d..074f753f7449428bc5779af874010d6aac50696d 100644 (file)
@@ -6720,9 +6720,6 @@ EXPORT_SYMBOL(yield);
 /*
  * 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.
- *
- * But don't do that if it is a deliberate, throttling IO wait (this task
- * has set its backing_dev_info: the queue against which it should throttle)
  */
 void __sched io_schedule(void)
 {
index a3b14090b1fb8f296ce9ce2fcec2bd2bbccd8d22..2c5d79236ead88fe692eb97eb0f4ec6b0388753a 100644 (file)
@@ -566,7 +566,8 @@ static void balance_dirty_pages(struct address_space *mapping,
                if (pages_written >= write_chunk)
                        break;          /* We've done our duty */
 
-               schedule_timeout_interruptible(pause);
+               __set_current_state(TASK_INTERRUPTIBLE);
+               io_schedule_timeout(pause);
 
                /*
                 * Increase the delay for each loop, up to our previous