Re: [PATCH RFC 1/2] crypto: Simple crypto algorithm load balancer

From: Herbert Xu
Date: Sat Jan 18 2014 - 07:12:25 EST

On Sat, Jan 18, 2014 at 12:46:08AM +0000, Tadeusz Struk wrote:
> Hi,
> In case of multiple crypto devices implementing the same algorithms
> the arbitration, which one to use is based on the cra_priority.
> Currently the algorithm with the highest priority is always be used.
> In case of two algorithms with the same priority the one added last is used.
> There is no load balancing and on a busy system there can be a situation when
> there more crypto accelerators, but only one is used for all crypto jobs
> and the others sit idle.
> This patch implements a simple load balancing based on the priority
> of an algorithm and its usage refctr. The distribution for 10 algorithms
> and 3000000 tfm_alloc allocations is as follows:

Have you looked at pcrypt and whether it can be extended to handle
this or perhaps something similar to pcrypt can be created?

Hard-coding this into the API seems a bit heavy-handed.

Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page:
PGP Key:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at