tags: Fix DEFINE_PER_CPU expansions
[deliverable/linux.git] / kernel / smp.c
index 07854477c16447ff87df874b4f117bcafadd4f33..300d29391e07416d73177c752ecca4afee21d3dd 100644 (file)
@@ -105,13 +105,12 @@ void __init call_function_init(void)
  * previous function call. For multi-cpu calls its even more interesting
  * as we'll have to ensure no other cpu is observing our csd.
  */
-static void csd_lock_wait(struct call_single_data *csd)
+static __always_inline void csd_lock_wait(struct call_single_data *csd)
 {
-       while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK)
-               cpu_relax();
+       smp_cond_acquire(!(csd->flags & CSD_FLAG_LOCK));
 }
 
-static void csd_lock(struct call_single_data *csd)
+static __always_inline void csd_lock(struct call_single_data *csd)
 {
        csd_lock_wait(csd);
        csd->flags |= CSD_FLAG_LOCK;
@@ -124,7 +123,7 @@ static void csd_lock(struct call_single_data *csd)
        smp_wmb();
 }
 
-static void csd_unlock(struct call_single_data *csd)
+static __always_inline void csd_unlock(struct call_single_data *csd)
 {
        WARN_ON(!(csd->flags & CSD_FLAG_LOCK));
 
@@ -669,7 +668,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
        cpumask_var_t cpus;
        int cpu, ret;
 
-       might_sleep_if(gfp_flags & __GFP_WAIT);
+       might_sleep_if(gfpflags_allow_blocking(gfp_flags));
 
        if (likely(zalloc_cpumask_var(&cpus, (gfp_flags|__GFP_NOWARN)))) {
                preempt_disable();
This page took 0.056651 seconds and 5 git commands to generate.