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

From: Linus Torvalds
Date: Mon May 15 2023 - 12:02:19 EST


On Mon, May 15, 2023 at 8:52 AM Jens Axboe <axboe@xxxxxxxxx> wrote:
>
> Only potential downside is that it does make file references more
> expensive for other syscalls, since you now have a shared file table.
> But probably not something to worry about here?

Would the vhost user worker user processes ever be otherwise single-threaded?

I'd *assume* that a vhost user is already doing its own threads. But
maybe that's a completely bogus assumption. I don't actually use any
of this, so...

Because you are obviously 100% right that if you're otherwise
single-threaded, then a CLONE_FILES kernel helper thread will cause
the extra cost for file descriptor lookup/free due to all the race
prevention.

Linus