Skip to content

Commit 09f40f9

Browse files
jankaraJens Axboe
authored andcommitted
mm: Add comment explaining task state setting in bdi_forker_thread()
CC: Wu Fengguang <[email protected]> CC: Andrew Morton <[email protected]> Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 5a042aa commit 09f40f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mm/backing-dev.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,13 @@ static int bdi_forker_thread(void *ptr)
401401
}
402402

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

406413
list_for_each_entry(bdi, &bdi_list, bdi_list) {

0 commit comments

Comments
 (0)