]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
mm: Add comment explaining task state setting in bdi_forker_thread()
authorJan Kara <jack@suse.cz>
Fri, 2 Sep 2011 23:04:10 +0000 (17:04 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 2 Sep 2011 23:17:02 +0000 (17:17 -0600)
CC: Wu Fengguang <fengguang.wu@intel.com>
CC: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
mm/backing-dev.c

index 94a047bb6c395d07958b4f4951b43a22c60445d8..a87da524a4a01ad288e10e9648593d8934adb4fc 100644 (file)
@@ -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) {