]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc/mm/nohash: Ignore NULL stale_map entries
authorScott Wood <scottwood@freescale.com>
Thu, 21 Mar 2013 00:06:12 +0000 (19:06 -0500)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Jun 2013 06:55:10 +0000 (16:55 +1000)
This happens with threads that are offline due to CPU hotplug
(including threads that were never "plugged in" to begin with because
SMT is disabled).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/mmu_context_nohash.c

index e779642c25e5e3192a39a4b167d505a8cfb63254..810f8e4d74d43c8d6047fcc7786721d1382440a1 100644 (file)
@@ -112,8 +112,10 @@ static unsigned int steal_context_smp(unsigned int id)
                 */
                for_each_cpu(cpu, mm_cpumask(mm)) {
                        for (i = cpu_first_thread_sibling(cpu);
-                            i <= cpu_last_thread_sibling(cpu); i++)
-                               __set_bit(id, stale_map[i]);
+                            i <= cpu_last_thread_sibling(cpu); i++) {
+                               if (stale_map[i])
+                                       __set_bit(id, stale_map[i]);
+                       }
                        cpu = i - 1;
                }
                return id;
@@ -272,7 +274,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
                /* XXX This clear should ultimately be part of local_flush_tlb_mm */
                for (i = cpu_first_thread_sibling(cpu);
                     i <= cpu_last_thread_sibling(cpu); i++) {
-                       __clear_bit(id, stale_map[i]);
+                       if (stale_map[i])
+                               __clear_bit(id, stale_map[i]);
                }
        }