[PATCH] mm: fix-up schedule_timeout() usage
authorNishanth Aravamudan <nacc@us.ibm.com>
Sat, 10 Sep 2005 07:27:25 +0000 (00:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 10 Sep 2005 17:06:37 +0000 (10:06 -0700)
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/oom_kill.c
mm/swapfile.c

index 5ec8da12cfd986523bb1968ffa9f2ea0be064868..ac3bf33e53701171bcf4b5f6ba8b1817bdac60f5 100644 (file)
@@ -300,6 +300,5 @@ retry:
         * Give "p" a good chance of killing itself before we
         * retry to allocate memory.
         */
-       __set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(1);
+       schedule_timeout_interruptible(1);
 }
index 4b6e8bf986bcad3080c23b9ad2424d24479d2f35..0184f510aacefd5cdce18b18a2d2f91008e255db 100644 (file)
@@ -1153,8 +1153,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
        p->highest_bit = 0;             /* cuts scans short */
        while (p->flags >= SWP_SCANNING) {
                spin_unlock(&swap_lock);
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(1);
+               schedule_timeout_uninterruptible(1);
                spin_lock(&swap_lock);
        }