[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 5 May 2023 15:40:19 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Mike Christie <michael.christie@...cle.com>, hch@...radead.org,
stefanha@...hat.com, jasowang@...hat.com, mst@...hat.com,
sgarzare@...hat.com, virtualization@...ts.linux-foundation.org,
brauner@...nel.org, ebiederm@...ssion.com,
torvalds@...ux-foundation.org, konrad.wilk@...cle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 8/8] vhost: use vhost_tasks for worker threads
Le 03/02/2023 à 00:25, Mike Christie a écrit :
> For vhost workers we use the kthread API which inherit's its values from
> and checks against the kthreadd thread. This results in the wrong RLIMITs
> being checked, so while tools like libvirt try to control the number of
> threads based on the nproc rlimit setting we can end up creating more
> threads than the user wanted.
>
> This patch has us use the vhost_task helpers which will inherit its
> values/checks from the thread that owns the device similar to if we did
> a clone in userspace. The vhost threads will now be counted in the nproc
> rlimits. And we get features like cgroups and mm sharing automatically,
> so we can remove those calls.
>
> Signed-off-by: Mike Christie <michael.christie@...cle.com>
> Acked-by: Michael S. Tsirkin <mst@...hat.com>
I have a question about (a side effect of?) this patch. The output of the 'ps'
command has changed. Here is an example:
Before:
$ ps
PID TTY TIME CMD
598 ttyS0 00:00:00 login
640 ttyS0 00:00:00 bash
8880 ttyS0 00:00:06 example:2
9389 ttyS0 00:00:00 ps
$ ps a
PID TTY STAT TIME COMMAND
598 ttyS0 Ss 0:00 /bin/login -p --
602 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
640 ttyS0 S 0:00 /bin/bash -li
8880 ttyS0 SLl 0:10 /usr/bin/example
9396 ttyS0 R+ 0:00 ps a
$ pgrep -f example
8880
After:
$ ps
PID TTY TIME CMD
538 ttyS0 00:00:00 login
574 ttyS0 00:00:00 bash
8275 ttyS0 00:03:28 example:2
8285 ttyS0 00:00:00 vhost-8275
8295 ttyS0 00:00:00 vhost-8275
8299 ttyS0 00:00:00 vhost-8275
9054 ttyS0 00:00:00 ps
$ ps a
PID TTY STAT TIME COMMAND
538 ttyS0 Ss 0:00 /bin/login -p --
540 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
574 ttyS0 S 0:00 /bin/bash -li
8275 ttyS0 SLl 3:28 /usr/bin/example
8285 ttyS0 SL 0:00 /usr/bin/example
8295 ttyS0 SL 0:00 /usr/bin/example
8299 ttyS0 SL 0:00 /usr/bin/example
9055 ttyS0 R+ 0:00 ps a
$ pgrep -f example
8275
8285
8295
8299
Is this an intended behavior?
This breaks some of our scripts.
Regards,
Nicolas
Powered by blists - more mailing lists