static void per_cpu_remove_cache(void *arg) { struct kmem_cache *cache = arg; struct qlist_head to_free = QLIST_INIT; struct qlist_head *q; q = this_cpu_ptr(&cpu_quarantine); qlist_move_cache(q, &to_free, cache); qlist_free_all(&to_free, cache); }
void quarantine_remove_cache(struct kmem_cache *cache) { unsigned long flags; struct qlist_head to_free = QLIST_INIT; on_each_cpu(per_cpu_remove_cache, cache, 1); spin_lock_irqsave(&quarantine_lock, flags); qlist_move_cache(&global_quarantine, &to_free, cache); spin_unlock_irqrestore(&quarantine_lock, flags); qlist_free_all(&to_free, cache); }
static void per_cpu_remove_cache(void *arg) { struct kmem_cache *cache = arg; struct qlist to_free = QLIST_INIT; struct qlist *q; unsigned long flags; local_irq_save(flags); q = this_cpu_ptr(&cpu_quarantine); qlist_move_cache(q, &to_free, cache); local_irq_restore(flags); qlist_free_all(&to_free, cache); }