Commit c47e1f41 authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: scomp - Allocate per-cpu buffer on first use of each CPU



Per-cpu buffers can be wasteful when the number of CPUs is large,
especially if the buffer itself is likely to never be used.  Reduce
such wastage by only allocating them on first use of a particular
CPU.

On start-up allocate a single buffer on the first possible CPU.
For every other CPU a work struct will be scheduled on first use
to allocate the buffer for that CPU.  Until the allocation succeeds
simply use the first CPU's buffer which is protected under a spin
lock.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 138804c2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment