• Ard Biesheuvel's avatar
    crypto: scompress - defer allocation of scratch buffer to first use · 6a8487a1
    Ard Biesheuvel authored
    The scompress code allocates 2 x 128 KB of scratch buffers for each CPU,
    so that clients of the async API can use synchronous implementations
    even from atomic context. However, on systems such as Cavium Thunderx
    (which has 96 cores), this adds up to a non-negligible 24 MB. Also,
    32-bit systems may prefer to use their precious vmalloc space for other
    things,especially since there don't appear to be any clients for the
    async compression API yet.
    
    So let's defer allocation of the scratch buffers until the first time
    we allocate an acompress cipher based on an scompress implementation.
    Signed-off-by: 's avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: 's avatarHerbert Xu <herbert@gondor.apana.org.au>
    6a8487a1
scompress.c 8.22 KB