On Fri, Jul 21, 2017 at 02:09:39PM +0100, Ard Biesheuvel wrote: > > Right. And is req->dst guaranteed to be assigned in that case? Because > crypto_scomp_sg_alloc() happily allocates pages and kmalloc()s the > scatterlist if req->dst == NULL. > > Is there any way we could make these scratch buffers part of the > request structure instead? Or at least defer allocating them until the > first call to crypto_scomp_init_tfm()? And on top of that, we should > probably only use the per-CPU scratch buffers if > CRYPTO_TFM_REQ_MAY_SLEEP is cleared, because in that case, we are not > pre-emptible to begin with, and the concern does not apply. Well for now scomp is new code so nothing actually uses it. But the idea is to convert IPcomp over to acomp and scomp will fill in as the compatibility glue. The medium/long-term plan is to convert IPcomp over to a partial decompression model so that we can allocate pages instead of a contiguous chunk as we do now. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt