aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-07-25 07:29:14 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:53:55 -0400
commitc4ec7908c2c5125f75fabd100e7a95626a6883ee (patch)
treed58ee401205de8385c74a04e9b66101fc9a6e22b /mm
parentc5f7ad233b8805dae06e694538d8095b19f3c560 (diff)
writeback: do not lose wake-ups in the forker thread - 2
Currently, if someone submits jobs for the default bdi, we can lose wake-up events. E.g., this can happen if 'bdi_queue_work()' is called when 'bdi_forker_thread()' is executing code after 'wb_do_writeback(me, 0)', but before 'set_current_state(TASK_INTERRUPTIBLE)'. This situation is unlikely, and the result is not very severe - we'll just delay the execution of the work, but this is still not very nice. This patch fixes the issue by checking whether the default bdi has works before the forker thread goes sleep. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/backing-dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index b1dc2d4b9cd..72e6eb96efe 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -358,6 +358,10 @@ static int bdi_forker_thread(void *ptr)
358 bdi_add_default_flusher_thread(bdi); 358 bdi_add_default_flusher_thread(bdi);
359 } 359 }
360 360
361 /* Keep working if default bdi still has things to do */
362 if (!list_empty(&me->bdi->work_list))
363 __set_current_state(TASK_RUNNING);
364
361 if (list_empty(&bdi_pending_list)) { 365 if (list_empty(&bdi_pending_list)) {
362 unsigned long wait; 366 unsigned long wait;
363 367