|
@@ -1384,10 +1384,23 @@ static void invalidate_bh_lru(void *arg)
|
|
|
}
|
|
|
put_cpu_var(bh_lrus);
|
|
|
}
|
|
|
+
|
|
|
+static bool has_bh_in_lru(int cpu, void *dummy)
|
|
|
+{
|
|
|
+ struct bh_lru *b = per_cpu_ptr(&bh_lrus, cpu);
|
|
|
+ int i;
|
|
|
|
|
|
+ for (i = 0; i < BH_LRU_SIZE; i++) {
|
|
|
+ if (b->bhs[i])
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
void invalidate_bh_lrus(void)
|
|
|
{
|
|
|
- on_each_cpu(invalidate_bh_lru, NULL, 1);
|
|
|
+ on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1, GFP_KERNEL);
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(invalidate_bh_lrus);
|
|
|
|