diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-09-08 01:22:26 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-09-08 01:22:26 -0700 |
| commit | a803561d87ce634e2243d824724560d2e0619bee (patch) | |
| tree | bc2b083503c61110b6df0740772375e98cdb9839 /kernel | |
| parent | 6eabceeed434ec59cefddcefc35273d1c15949c9 (diff) | |
[power] Add support for refrigerator to the migration_thread.
- The PM code currently must signal each kernel thread when suspending, and
each thread must call refrigerator() to stop itself. This patch adds
support for this to migration_thread, which allows suspend states to work
on an SMP-enabled kernel (though not necessarily an SMP machine).
- Note I do not know why the process freezing code was designed in such a
way. One would think we could do it without having to call each thread
individually, and fix up the threads that need special work individually..
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 51241d70f924..b98cac028af6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -28,6 +28,7 @@ #include <linux/kernel_stat.h> #include <linux/security.h> #include <linux/notifier.h> +#include <linux/suspend.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/timer.h> @@ -2415,6 +2416,9 @@ static int migration_thread(void * data) struct list_head *head; migration_req_t *req; + if (current->flags & PF_FREEZE) + refrigerator(PF_IOTHREAD); + spin_lock_irq(&rq->lock); head = &rq->migration_queue; current->state = TASK_INTERRUPTIBLE; |
