Draft: Reduce the number of mctx created in clientmgr

Closed Ondřej Surý requested to merge 2433-reduce-clientmgr-memory-contexts-and-tasks-v9_16 into v9_16

The number of memory contexts created in the clientmgr was enormous. It could easily create thousands of memory contexts because the formula was:

nprotocols * ncpus * ninterfaces * CLIENT_NMCTXS_PERCPU (8)

The original goal was to reduce the contention when allocating the memory, but after a while nobody noticed that the amount of memory context allocated would not reduce contention at all.

This commit removes the whole mctxpool and just uses the mctx from clientmgr as the contention will be reduced directly in the allocator.

(cherry picked from commit 798cd300)

Closes #2433 (closed)

Merge request reports