aboutsummaryrefslogtreecommitdiffstats
path: root/module/spl/spl-zlib.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2012-09-07 14:28:07 -0700
committerBrian Behlendorf <[email protected]>2012-09-07 14:36:26 -0700
commit95331f4437d57f0d0a719d38355159b90a52f40d (patch)
treebc5dcab56c1c83d1e160e0539f545da37c37deff /module/spl/spl-zlib.c
parentcb5c2acebb86da5b50f099b39209d22845eda8c7 (diff)
Set KMC_NOEMERGENCY for zlib workspaces
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 <[email protected]> zfsonlinux/zfs#917
Diffstat (limited to 'module/spl/spl-zlib.c')
-rw-r--r--module/spl/spl-zlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c
index 7bed00ca4..4f88cb4e0 100644
--- a/module/spl/spl-zlib.c
+++ b/module/spl/spl-zlib.c
@@ -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);