]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Set KMC_NOEMERGENCY for zlib workspaces
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Sep 2012 21:28:07 +0000 (14:28 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Sep 2012 21:36:26 +0000 (14:36 -0700)
The workspace required by zlib to perform compression is roughly
512MB (order-7).  These allocations are so large that we should
never attempt to directly kmalloc an emergency object for them.

It is far preferable to asynchronously vmalloc an additional slab
in case it's needed.  Then simply block waiting for an existing
object to be released or for the new slab to be allocated.

This can be accomplished by disabling emergency slab objects by
passing the KMC_NOEMERGENCY flag at slab creation time.

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

module/spl/spl-zlib.c

index 7bed00ca46495c90b57347fbfab50c25c3ccd8b9..4f88cb4e05db00f9b45db60fefe8201c56fad293 100644 (file)
@@ -205,8 +205,10 @@ spl_zlib_init(void)
        size = MAX(spl_zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
            zlib_inflate_workspacesize());
 
-       zlib_workspace_cache = kmem_cache_create("spl_zlib_workspace_cache",
-           size, 0, NULL, NULL, NULL, NULL, NULL, KMC_VMEM);
+       zlib_workspace_cache = kmem_cache_create(
+           "spl_zlib_workspace_cache",
+           size, 0, NULL, NULL, NULL, NULL, NULL,
+           KMC_VMEM | KMC_NOEMERGENCY);
         if (!zlib_workspace_cache)
                SRETURN(1);