Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-21 Thread Stefan Hajnoczi
On Thu, Jun 17, 2021 at 09:49:07PM -0500, Mike Christie wrote: > Again it's io_uring. Check out fs/io_uring.c:__io_account_mem(). For > RLIMIT_MEMLOCK > it just does the check and increments the user's counter itself. It's simple > like > option 2, and it handles the issue where the process

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-17 Thread Mike Christie
On 6/10/21 3:06 AM, Stefan Hajnoczi wrote: > On Wed, Jun 09, 2021 at 04:03:55PM -0500, Mike Christie wrote: >> On 6/7/21 10:19 AM, Stefan Hajnoczi wrote: >>> My concern is that threads should probably accounted against >>> RLIMIT_NPROC and max_threads rather than something indirect like 128 * >>>

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-10 Thread Stefan Hajnoczi
On Wed, Jun 09, 2021 at 04:03:55PM -0500, Mike Christie wrote: > On 6/7/21 10:19 AM, Stefan Hajnoczi wrote: > > My concern is that threads should probably accounted against > > RLIMIT_NPROC and max_threads rather than something indirect like 128 * > > RLIMIT_NOFILE (a userspace process can only

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-09 Thread Mike Christie
On 6/7/21 10:19 AM, Stefan Hajnoczi wrote: > My concern is that threads should probably accounted against > RLIMIT_NPROC and max_threads rather than something indirect like 128 * > RLIMIT_NOFILE (a userspace process can only have RLIMIT_NOFILE > vhost-user file descriptors open). > Ah ok, I see

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-07 Thread Stefan Hajnoczi
On Sat, Jun 05, 2021 at 06:53:58PM -0500, michael.chris...@oracle.com wrote: > On 6/3/21 9:30 AM, Stefan Hajnoczi wrote: > >> + if (info->pid == VHOST_VRING_NEW_WORKER) { > >> + worker = vhost_worker_create(dev); > > > > The maximum number of kthreads created is limited by > >

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-05 Thread michael . christie
On 6/3/21 9:30 AM, Stefan Hajnoczi wrote: >> +if (info->pid == VHOST_VRING_NEW_WORKER) { >> +worker = vhost_worker_create(dev); > > The maximum number of kthreads created is limited by > vhost_dev_init(nvqs)? For example VHOST_SCSI_MAX_VQ 128. > > IIUC kthread_create is not

Re: [PATCH 7/9] vhost: allow userspace to create workers

2021-06-03 Thread Stefan Hajnoczi
On Tue, May 25, 2021 at 01:05:58PM -0500, Mike Christie wrote: > This patch allows userspace to create workers and bind them to vqs, so you > can have N workers per dev and also share N workers with M vqs. The next > patch will allow sharing across devices. > > Signed-off-by: Mike Christie > ---

[PATCH 7/9] vhost: allow userspace to create workers

2021-05-25 Thread Mike Christie
This patch allows userspace to create workers and bind them to vqs, so you can have N workers per dev and also share N workers with M vqs. The next patch will allow sharing across devices. Signed-off-by: Mike Christie --- drivers/vhost/vhost.c| 94 +++-