diff -ruNp 270-fork-non-conflicting-pages-for-copyback-old/kernel/fork.c 270-fork-non-conflicting-pages-for-copyback-new/kernel/fork.c --- 270-fork-non-conflicting-pages-for-copyback-old/kernel/fork.c 2005-07-30 20:47:12.000000000 +1000 +++ 270-fork-non-conflicting-pages-for-copyback-new/kernel/fork.c 2005-07-30 20:47:04.000000000 +1000 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -163,7 +164,17 @@ static struct task_struct *dup_task_stru if (!tsk) return NULL; - ti = alloc_thread_info(tsk); +#ifdef CONFIG_SUSPEND2 + if (test_suspend_state(SUSPEND_FORK_COPYBACK_THREAD)) { + extern void * suspend2_get_nonconflicting_pages(int); + ti = suspend2_get_nonconflicting_pages(get_order(THREAD_SIZE)); + printk("Starting a copyback thread %p\n", ti); + } else +#endif + { + ti = alloc_thread_info(tsk); + } + if (!ti) { free_task_struct(tsk); return NULL; @@ -1219,6 +1230,10 @@ long do_fork(unsigned long clone_flags, if (pid < 0) return -EAGAIN; + + /* Is the refrigerator fully on? */ + BUG_ON(test_suspend_state(SUSPEND_DISABLE_SYNCING)); + if (unlikely(current->ptrace)) { trace = fork_traceflag (clone_flags); if (trace)