Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_slab.c
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | else if (unlikely(curthread->td_critnest != 0)) | ||||
lkpi_kmem_cache_free_async(c, m); | lkpi_kmem_cache_free_async(c, m); | ||||
else | else | ||||
lkpi_kmem_cache_free_sync(c, m); | lkpi_kmem_cache_free_sync(c, m); | ||||
} | } | ||||
void | void | ||||
linux_kmem_cache_destroy(struct linux_kmem_cache *c) | linux_kmem_cache_destroy(struct linux_kmem_cache *c) | ||||
{ | { | ||||
if (c == NULL) | |||||
emaste: We're already using `unlikely()s` here, maybe add it on this test? | |||||
Done Inline ActionsIt really doesn't make sense here, this function is very expensive and rarely called. markj: It really doesn't make sense here, this function is very expensive and rarely called. | |||||
return; | |||||
if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { | if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { | ||||
/* make sure all free callbacks have been called */ | /* make sure all free callbacks have been called */ | ||||
rcu_barrier(); | rcu_barrier(); | ||||
} | } | ||||
if (!llist_empty(&c->cache_items)) | if (!llist_empty(&c->cache_items)) | ||||
taskqueue_enqueue(linux_irq_work_tq, &c->cache_task); | taskqueue_enqueue(linux_irq_work_tq, &c->cache_task); | ||||
taskqueue_drain(linux_irq_work_tq, &c->cache_task); | taskqueue_drain(linux_irq_work_tq, &c->cache_task); | ||||
Show All 23 Lines |
We're already using unlikely()s here, maybe add it on this test?