diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 361030b181..f7d5f7e86b 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -880,6 +880,16 @@ kv_free(spl_kmem_cache_t *skc, void *ptr, int size) ASSERT(IS_P2ALIGNED(ptr, PAGE_SIZE)); ASSERT(ISP2(size)); + /* + * The Linux direct reclaim path uses this out of band value to + * determine if forward progress is being made. Normally this is + * incremented by kmem_freepages() which is part of the various + * Linux slab implementations. However, since we are using none + * of that infrastructure we are responsible for incrementing it. + */ + if (current->reclaim_state) + current->reclaim_state->reclaimed_slab += size >> PAGE_SHIFT; + if (skc->skc_flags & KMC_KMEM) free_pages((unsigned long)ptr, get_order(size)); else