From: Jan Kara Date: Fri, 2 Sep 2011 23:04:10 +0000 (-0600) Subject: mm: Add comment explaining task state setting in bdi_forker_thread() X-Git-Tag: firefly_0821_release~3680^2~4430^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=09f40f98bfa2ac22a332a713629a2f8f92896834;p=firefly-linux-kernel-4.4.55.git mm: Add comment explaining task state setting in bdi_forker_thread() CC: Wu Fengguang CC: Andrew Morton Signed-off-by: Jan Kara Signed-off-by: Jens Axboe --- diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 94a047bb6c39..a87da524a4a0 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -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) {