Re: [PATCH v11 8/8] vhost: use vhost_tasks for worker threads

From: Linus Torvalds
Date: Fri May 05 2023 - 14:22:35 EST


On Fri, May 5, 2023 at 6:40 AM Nicolas Dichtel
<nicolas.dichtel@xxxxxxxxx> wrote:
>
> Is this an intended behavior?
> This breaks some of our scripts.

It doesn't just break your scripts (which counts as a regression), I
think it's really wrong.

The worker threads should show up as threads of the thing that started
them, not as processes.

So they should show up in 'ps' only when one of the "show threads" flag is set.

But I suspect the fix is trivial: the virtio code should likely use
CLONE_THREAD for the copy_process() it does.

It should look more like "create_io_thread()" than "copy_process()", I think.

For example, do virtio worker threads really want their own signals
and files? That sounds wrong. create_io_thread() uses all of

CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_IO

to share much more of the context with the process it is actually run within.

Christian? Mike?

Linus