mbox series

[0/3] crypto: scomp - Allocate per-cpu buffers on first use

Message ID cover.1742200161.git.herbert@gondor.apana.org.au (mailing list archive)
Headers show
Series crypto: scomp - Allocate per-cpu buffers on first use | expand

Message

Herbert Xu March 17, 2025, 8:33 a.m. UTC
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.

The first two patches create the gound-work so that scomp can
safely flush work structs in its cra_destroy function.  The last
patch implements allocation on first use.

Herbert Xu (3):
  crypto: api - Move alg destroy work from instance to template
  crypto: api - Ensure cra_type->destroy is done in process context
  crypto: scomp - Allocate per-cpu buffer on first use of each CPU

 crypto/algapi.c                     |  48 +++++--
 crypto/api.c                        |  10 --
 crypto/internal.h                   |   3 +-
 crypto/scompress.c                  | 203 ++++++++++++++++++++++------
 include/crypto/acompress.h          |   6 -
 include/crypto/algapi.h             |   5 +-
 include/crypto/internal/acompress.h |   1 -
 include/crypto/internal/scompress.h |  13 ++
 8 files changed, 214 insertions(+), 75 deletions(-)