Re: [PATCH v2] kernel/fork: Increase minimum number of allowed threads

From: Hillf Danton
Date: Mon Jul 21 2025 - 18:57:53 EST


On Sun, 20 Jul 2025 17:28:20 +0200 Hauke Mehrtens wrote:
> Hi,
>
> I am not exactly sure how I should limit the number of parallel user
> mode helper calls.
> The user mode helper is calling wait_for_initramfs() so it could be that
> some calls are getting queued at the early bootup. This is probably the
> problem I am hitting.
>
> I do not want to block the device creation till the user mode helper
> finished. This could also result in a deadlock and would probably slow
> down bootup.
>
> When I limit the number of user mode helper calls to 1 and let the
> others wait in a system queue, I might block other unrelated tasks in
> the system queue.
>
Can you specify how system queue is blocked, after a look at the false
deadlock [1]?

[1] https://lore.kernel.org/lkml/20240927112516.1136-1-hdanton@xxxxxxxx/

> I would create an own queue and let the async user mode helper wait in
> this queue to only execute one at a time. When one of them needs a long
> time in user space it would block the others. This workqueue would also
> be active all the time. After the bootup it would probably not do much
> work any more.
>
> I do not like any of these solutions. Do you have better ideas?