mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-24 18:39:34 +03:00
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 <behlendorf1@llnl.gov> zfsonlinux/zfs#917
This commit is contained in:
parent
cb5c2acebb
commit
95331f4437
@ -205,8 +205,10 @@ spl_zlib_init(void)
|
|||||||
size = MAX(spl_zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
|
size = MAX(spl_zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
|
||||||
zlib_inflate_workspacesize());
|
zlib_inflate_workspacesize());
|
||||||
|
|
||||||
zlib_workspace_cache = kmem_cache_create("spl_zlib_workspace_cache",
|
zlib_workspace_cache = kmem_cache_create(
|
||||||
size, 0, NULL, NULL, NULL, NULL, NULL, KMC_VMEM);
|
"spl_zlib_workspace_cache",
|
||||||
|
size, 0, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
KMC_VMEM | KMC_NOEMERGENCY);
|
||||||
if (!zlib_workspace_cache)
|
if (!zlib_workspace_cache)
|
||||||
SRETURN(1);
|
SRETURN(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user