Skip to content

Commit

Permalink
mm: Add comment explaining task state setting in bdi_forker_thread()
Browse files Browse the repository at this point in the history
CC: Wu Fengguang <[email protected]>
CC: Andrew Morton <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
jankara authored and Jens Axboe committed Sep 2, 2011
1 parent 5a042aa commit 09f40f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@ static int bdi_forker_thread(void *ptr)
}

spin_lock_bh(&bdi_lock);
/*
* In the following loop we are going to check whether we have
* some work to do without any synchronization with tasks
* waking us up to do work for them. So we have to set task
* state already here so that we don't miss wakeups coming
* after we verify some condition.
*/
set_current_state(TASK_INTERRUPTIBLE);

list_for_each_entry(bdi, &bdi_list, bdi_list) {
Expand Down

0 comments on commit 09f40f9

Please sign in to comment.