patch-2.3.43 linux/mm/vmscan.c

Next file: linux/net/atm/atm_misc.c
Previous file: linux/mm/swapfile.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -451,7 +451,7 @@
 	return priority >= 0;
 }
 
-static struct task_struct *kswapd_process;
+DECLARE_WAIT_QUEUE_HEAD(kswapd_wait);
 
 /*
  * The background pageout daemon, started as a kernel thread
@@ -471,7 +471,6 @@
 {
 	struct task_struct *tsk = current;
 
-	kswapd_process = tsk;
 	tsk->session = 1;
 	tsk->pgrp = 1;
 	strcpy(tsk->comm, "kswapd");
@@ -510,7 +509,7 @@
 			run_task_queue(&tq_disk);
 		} while (!tsk->need_resched);
 		tsk->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(HZ);
+		interruptible_sleep_on(&kswapd_wait);
 	}
 }
 
@@ -533,7 +532,6 @@
 {
 	int retval = 1;
 
-	wake_up_process(kswapd_process);
 	if (gfp_mask & __GFP_WAIT) {
 		current->flags |= PF_MEMALLOC;
 		retval = do_try_to_free_pages(gfp_mask, zone);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)