sched/rt: Use schedule_preempt_disabled()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 21 Mar 2011 11:33:18 +0000 (12:33 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 1 Mar 2012 09:28:03 +0000 (10:28 +0100)
Coccinelle based conversion.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-24swm5zut3h9c4a6s46x8rws@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
28 files changed:
arch/arm/kernel/process.c
arch/avr32/kernel/process.c
arch/blackfin/kernel/process.c
arch/cris/kernel/process.c
arch/frv/kernel/process.c
arch/h8300/kernel/process.c
arch/ia64/kernel/process.c
arch/m32r/kernel/process.c
arch/m68k/kernel/process_mm.c
arch/m68k/kernel/process_no.c
arch/microblaze/kernel/process.c
arch/mips/kernel/process.c
arch/mn10300/kernel/process.c
arch/parisc/kernel/process.c
arch/powerpc/kernel/idle.c
arch/powerpc/platforms/iseries/setup.c
arch/s390/kernel/process.c
arch/score/kernel/process.c
arch/sh/kernel/idle.c
arch/sparc/kernel/process_32.c
arch/sparc/kernel/process_64.c
arch/tile/kernel/process.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/xtensa/kernel/process.c
init/main.c
kernel/mutex.c
kernel/softirq.c

index 971d65c253a920c682f818f3f341a0102450f0ba..c2ae3cd331feea2e9ea37439cdde6dd458711db1 100644 (file)
@@ -239,9 +239,7 @@ void cpu_idle(void)
                leds_event(led_idle_end);
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index ea33957503243c44ce8eaed1b7d114fec608f792..92c5af98a6f76be5f762b2e8c05936ddde5dfdc4 100644 (file)
@@ -40,9 +40,7 @@ void cpu_idle(void)
                        cpu_idle_sleep();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 8dd0416673cb56f631e2b6f45db7af749982730d..a80a643f3691bc4bc02a3ff453b24bde8783b97d 100644 (file)
@@ -94,9 +94,7 @@ void cpu_idle(void)
                        idle();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index aa585e4e979eca9b7aacad7721f4116353790587..d8f50ff6fadd07058925d80af879d322599a5f6d 100644 (file)
@@ -115,9 +115,7 @@ void cpu_idle (void)
                                idle = default_idle;
                        idle();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 3901df1213c0f24454f37a755ddb3e83cd9d978b..29cc49783787224ac84961b1577e2e7b02b32c9f 100644 (file)
@@ -92,9 +92,7 @@ void cpu_idle(void)
                                idle();
                }
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 933bd388efb28c35804b482aab8014f75036afce..1a173b35f47556c6448a40a1fc70a5ba4b5b748e 100644 (file)
@@ -81,9 +81,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 6d33c5cc94f01fb207168592c1caadac7c5faa79..9dc52b63fc876d258955568782b1ace3c107d01d 100644 (file)
@@ -330,9 +330,7 @@ cpu_idle (void)
                        normal_xtp();
 #endif
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
                if (cpu_is_offline(cpu))
                        play_dead();
index 422bea9f1dbcbcab749fe0d6a7317d366de45ba1..3a4a32b2720802b77cf2385ac7c43f3e6ba33b11 100644 (file)
@@ -90,9 +90,7 @@ void cpu_idle (void)
 
                        idle();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 099283ee1a8fd0810672f2a36ad038786799dc5d..fe4186b5fc32997047f654cbd8eabe891915e1f2 100644 (file)
@@ -78,9 +78,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 5e1078cabe0e54bf10d4537aa86eaa11c8b0e8a5..f7fe6c3485954e9754c353a1c48c81b09c41b7fd 100644 (file)
@@ -73,9 +73,7 @@ void cpu_idle(void)
        /* endless idle loop with no priority at all */
        while (1) {
                idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 7dcb5bfffb75527a6875e7c41ed701d973d44c4c..9155f7d92669a8cdf6acb5c3c6c10c21c9ed2d00 100644 (file)
@@ -110,9 +110,7 @@ void cpu_idle(void)
                rcu_idle_exit();
                tick_nohz_idle_exit();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 7955409051c479e1075fa424dd02f993731fbd53..61f1cb45a1d5ff2539c251662ac5db66dd770ff9 100644 (file)
@@ -80,9 +80,7 @@ void __noreturn cpu_idle(void)
 #endif
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 28eec3102535c86c91649b336aeb0b9f5677b75c..cac401d37f7546c4353c9e3df6ecd747fed8063b 100644 (file)
@@ -123,9 +123,7 @@ void cpu_idle(void)
                        idle();
                }
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 62c60b87d0395d66b02a929095fe37bbb33b849b..d4b94b395c1641f6a3c88bf9b50795b36e86d09f 100644 (file)
@@ -71,9 +71,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        barrier();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 0a48bf5db6c84bfbf0152a9b3c52e83b9f43646d..65035141552b2543a2786d219346036a00a4ca3a 100644 (file)
@@ -101,11 +101,11 @@ void cpu_idle(void)
                ppc64_runlatch_on();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               if (cpu_should_die())
+               if (cpu_should_die()) {
+                       preempt_enable_no_resched();
                        cpu_die();
-               schedule();
-               preempt_disable();
+               }
+               schedule_preempt_disabled();
        }
 }
 
index 8fc62586a973a8017179b90df32203aa36dea60f..a5fbf4cb632940bd96e0774fb9190735200c938b 100644 (file)
@@ -584,9 +584,7 @@ static void iseries_shared_idle(void)
                if (hvlpevent_is_pending())
                        process_iSeries_events();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
@@ -615,9 +613,7 @@ static void iseries_dedicated_idle(void)
                ppc64_runlatch_on();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index e795933eb2cbaaf446d5ea62c0b43976d38479f0..7618085b416431379adafe2c1f7e65ea74c0b133 100644 (file)
@@ -97,9 +97,7 @@ void cpu_idle(void)
                tick_nohz_idle_exit();
                if (test_thread_flag(TIF_MCCK_PENDING))
                        s390_handle_mcck();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 25d08030a8837372106238c315524e17f9222c22..2707023c75637fc4f87f43845bc4eb03cadb2f21 100644 (file)
@@ -53,9 +53,7 @@ void __noreturn cpu_idle(void)
                while (!need_resched())
                        barrier();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 406508d4ce742d1cffb375dfdd1bee911b6adf76..7e4892826563e73b47f7e4364a41ad06f959beea 100644 (file)
@@ -114,9 +114,7 @@ void cpu_idle(void)
 
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index f793742eec2b075395f9e71c4af50bac780dbe25..935fdbcd88c20b5d64a9c965e102e47edfe1048a 100644 (file)
@@ -113,9 +113,7 @@ void cpu_idle(void)
                        while (!need_resched())
                                cpu_relax();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
@@ -138,9 +136,7 @@ void cpu_idle(void)
                        while (!need_resched())
                                cpu_relax();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 39d8b05201a23bd83eb6866d05477f3b34664957..ab9a292682130375825b1e2eff14a81aca598db6 100644 (file)
@@ -104,15 +104,13 @@ void cpu_idle(void)
                rcu_idle_exit();
                tick_nohz_idle_exit();
 
-               preempt_enable_no_resched();
-
 #ifdef CONFIG_HOTPLUG_CPU
-               if (cpu_is_offline(cpu))
+               if (cpu_is_offline(cpu)) {
+                       preempt_enable_no_resched();
                        cpu_play_dead();
+               }
 #endif
-
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 4c1ac6e5347ac687bdbb4de54be8a736485d9416..6ae495ef2b99db3b5f006bfe5d6011dd0a0c8cc6 100644 (file)
@@ -108,9 +108,7 @@ void cpu_idle(void)
                }
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index c08d1ff12b7c4087dd01ad6f2ba8ea5bcc8ba04a..49888fefe79434de793d8986cb2b98a5fe9c9d8f 100644 (file)
@@ -119,9 +119,7 @@ void cpu_idle(void)
                }
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index cfa5c90c01dbe0c170587ae8891a1fa419aa2e36..e34257c70c28fef1cb0864d8530d2ef8e1d42234 100644 (file)
@@ -156,9 +156,7 @@ void cpu_idle(void)
                }
 
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 47041e7c088c58da4fadacd77d57995ab438d21c..2c9004770c4e1d0ca3aa63a10128510bbccab659 100644 (file)
@@ -113,9 +113,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        platform_idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index ff49a6dacfbbdf673e38f4797127c5e4b8de8c73..4990f7ec776af2ec84a5783727589fd8e2655488 100644 (file)
@@ -374,11 +374,8 @@ static noinline void __init_refok rest_init(void)
         * at least once to get things moving:
         */
        init_idle_bootup_task(current);
-       preempt_enable_no_resched();
-       schedule();
-
+       schedule_preempt_disabled();
        /* Call into cpu_idle with preempt disabled */
-       preempt_disable();
        cpu_idle();
 }
 
index 89096dd8786f8e6ca02fa98023a569d6d80df747..a307cc9c9526e7c5a5514cfb0988d804e6300f7c 100644 (file)
@@ -240,9 +240,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 
                /* didn't get the lock, go to sleep: */
                spin_unlock_mutex(&lock->wait_lock, flags);
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                spin_lock_mutex(&lock->wait_lock, flags);
        }
 
index 4eb3a0fa351e788297e7d14f0f56cec66d61c1ae..79b524767a24b9f2705f46eeedd3eecdbd33dbb6 100644 (file)
@@ -744,9 +744,7 @@ static int run_ksoftirqd(void * __bind_cpu)
        while (!kthread_should_stop()) {
                preempt_disable();
                if (!local_softirq_pending()) {
-                       preempt_enable_no_resched();
-                       schedule();
-                       preempt_disable();
+                       schedule_preempt_disabled();
                }
 
                __set_current_state(TASK_RUNNING);