Re: threads-max observe limits

From: Michal Hocko
Date: Tue Sep 24 2019 - 04:48:58 EST


On Mon 23-09-19 16:23:40, Eric W. Biederman wrote:
>
> Michal,
>
> Thinking about this I have a hunch about what changed. I think at some
> point we changed from 4k to 8k kernel stacks. So I suspect if your
> client is seeing a lower threads-max it is because the size of the
> kernel data structures increased.

This is indeed the case. Starting since 6538b8ea886e ("x86_64: expand
kernel stack to 16K") (3.16) we use THREAD_SIZE_ORDER = 2 and that
halved the auto-tuned value.

In the particular case
3.12
kernel.threads-max = 515561

4.4
kernel.threads-max = 200000

Neither of the two values is really insane on 32GB machine.

I am not sure we want/need to tune the max_thread value further. If
anything the tuning should be removed altogether if proven not useful in
general. But we definitely need a way to override this auto-tuning.

Thanks
--
Michal Hocko
SUSE Labs