Hello,
This is an attempt to make crypto(9) multi threaded: it is now possible to spawn multi crypto worker/ret workers.
As before, each worker has its own job queue.
The goal is to boost non hardware accelerated crypto operations, using the BATCH mode. In that case, you can spread crypto jobs on several workers, and then benefit from parallel executions.
Currently the choice of the worker is based on the session id. This is the easiest choice to keep the jobs ordered.
The second step would be to spread the crypto jobs on several workers, and use the return workers to reorder the jobs.
The goal is then to boost operations when only a few sessions are involved.
Here is what I thought:
- spawn as many workers as CPU
- pin each worker/ret worker on a single CPU
- make a global counter per CPU, and use it to mark each crypto job with a tuple { crp_worker_id (=curcpu), crp_seq}
- load balance the jobs on the workers
- once the crypto is processed, put the job in the original worker queue, at the correct place (thanks to the worker_id/crp_seq info)
- the return worker makes sure to redispatch the jobs in the correct order (no "hole")
What do you think?
(Please feel free to add relevant people)