]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/kasan/quarantine.c
Add clock changes and mute gpios (#1938)
[mirror_ubuntu-zesty-kernel.git] / mm / kasan / quarantine.c
index dae929c02bbb991cd0f50493a431af2ea6c36c29..872e1981f63b00417c68bbf0028590109f6831da 100644 (file)
@@ -282,8 +282,15 @@ void quarantine_remove_cache(struct kmem_cache *cache)
        on_each_cpu(per_cpu_remove_cache, cache, 1);
 
        spin_lock_irqsave(&quarantine_lock, flags);
-       for (i = 0; i < QUARANTINE_BATCHES; i++)
+       for (i = 0; i < QUARANTINE_BATCHES; i++) {
+               if (qlist_empty(&global_quarantine[i]))
+                       continue;
                qlist_move_cache(&global_quarantine[i], &to_free, cache);
+               /* Scanning whole quarantine can take a while. */
+               spin_unlock_irqrestore(&quarantine_lock, flags);
+               cond_resched();
+               spin_lock_irqsave(&quarantine_lock, flags);
+       }
        spin_unlock_irqrestore(&quarantine_lock, flags);
 
        qlist_free_all(&to_free, cache);