Skip to content

Commit

Permalink
writeback: account IO throttling wait as iowait
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wu Fengguang authored and Jens Axboe committed Oct 9, 2009
1 parent 8c27959 commit d25105e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d25105e

Please sign in to comment.