]> git.proxmox.com Git - mirror_spl.git/commitdiff
Fix bogus kmem leak warning
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 10 Jul 2013 22:04:07 +0000 (15:04 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 10 Jul 2013 22:08:22 +0000 (15:08 -0700)
Commit 5c7a036 correctly relocated the creation of a taskq
and the registraction of the kmem_cache_shrinker after the
initialization of the kmem tracking code.  However, the
cleanup of these structures was not done before the leak
checks in spl_kmem_fini().  This resulted in an incorrect
'kmem leaked' warning even though there was no actual leak.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/zfs#1569

module/spl/spl-kmem.c

index f982ed0adc9e89e455908bf6f51c6e7931636095..8547fa74fa5a70986d37a0e56a43f8a7eddf0dc1 100644 (file)
@@ -2439,6 +2439,11 @@ spl_kmem_init(void)
 void
 spl_kmem_fini(void)
 {
+       SENTRY;
+
+       spl_unregister_shrinker(&spl_kmem_cache_shrinker);
+       taskq_destroy(spl_kmem_cache_taskq);
+
 #ifdef DEBUG_KMEM
        /* Display all unreclaimed memory addresses, including the
         * allocation size and the first few bytes of what's located
@@ -2458,10 +2463,6 @@ spl_kmem_fini(void)
        spl_kmem_fini_tracking(&kmem_list, &kmem_lock);
        spl_kmem_fini_tracking(&vmem_list, &vmem_lock);
 #endif /* DEBUG_KMEM */
-       SENTRY;
-
-       spl_unregister_shrinker(&spl_kmem_cache_shrinker);
-       taskq_destroy(spl_kmem_cache_taskq);
 
        SEXIT;
 }