Merge branch 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kerne...
[safe/jmp/linux-2.6] / kernel / slow-work.c
index 3f65900..521ed20 100644 (file)
@@ -7,6 +7,8 @@
  * modify it under the terms of the GNU General Public Licence
  * as published by the Free Software Foundation; either version
  * 2 of the Licence, or (at your option) any later version.
+ *
+ * See Documentation/slow-work.txt
  */
 
 #include <linux/module.h>
@@ -370,8 +372,8 @@ static int slow_work_thread(void *_data)
                vsmax *= atomic_read(&slow_work_thread_count);
                vsmax /= 100;
 
-               prepare_to_wait(&slow_work_thread_wq, &wait,
-                               TASK_INTERRUPTIBLE);
+               prepare_to_wait_exclusive(&slow_work_thread_wq, &wait,
+                                         TASK_INTERRUPTIBLE);
                if (!freezing(current) &&
                    !slow_work_threads_should_exit &&
                    !slow_work_available(vsmax) &&
@@ -607,14 +609,14 @@ void slow_work_unregister_user(void)
        if (slow_work_user_count == 0) {
                printk(KERN_NOTICE "Slow work thread pool: Shutting down\n");
                slow_work_threads_should_exit = true;
+               del_timer_sync(&slow_work_cull_timer);
+               del_timer_sync(&slow_work_oom_timer);
                wake_up_all(&slow_work_thread_wq);
                wait_for_completion(&slow_work_last_thread_exited);
                printk(KERN_NOTICE "Slow work thread pool:"
                       " Shut down complete\n");
        }
 
-       del_timer_sync(&slow_work_cull_timer);
-
        mutex_unlock(&slow_work_user_lock);
 }
 EXPORT_SYMBOL(slow_work_unregister_user);