Commit 09f40f98 authored by Jan Kara's avatar Jan Kara Committed by Jens Axboe

mm: Add comment explaining task state setting in bdi_forker_thread()

CC: Wu Fengguang <fengguang.wu@intel.com>
CC: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 5a042aa4
...@@ -401,6 +401,13 @@ static int bdi_forker_thread(void *ptr) ...@@ -401,6 +401,13 @@ static int bdi_forker_thread(void *ptr)
} }
spin_lock_bh(&bdi_lock); 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); set_current_state(TASK_INTERRUPTIBLE);
list_for_each_entry(bdi, &bdi_list, bdi_list) { list_for_each_entry(bdi, &bdi_list, bdi_list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment