WorldCist'22 - 10th World Conference on IST | Montenegro | Deadline: November 24

2021-11-21 Thread WorldCIST
* Conference listed in CORE Ranking ** Google Scholar H5-Index = 23 *** Best papers selected for SCI/SSCI journals -- WorldCIST'22 - 10th World Conference on Information Systems and Technol

[PATCH V5 02/10] fork/vm: Move common PF_IO_WORKER behavior to new flag

2021-11-21 Thread Mike Christie
This adds a new flag, PF_USER_WORKER, that's used for behavior common to to both PF_IO_WORKER and users like vhost which will use the new kernel_worker helpers that will use the flag and are added later in this patchset. The common behavior PF_USER_WORKER covers is the initial frame and fpu setup

[PATCH V5 05/10] signal: Perfom autoreap for PF_USER_WORKER

2021-11-21 Thread Mike Christie
Userspace doesn't know about PF_USER_WORKER threads, so it can't do wait to clean them up. For cases like where qemu will do dynamic/hot add/remove of vhost devices, then we need to auto reap the thread like was done for the kthread case, because qemu does not know what API the kernel/vhost layer i

[PATCH V5 04/10] fork: Add KERNEL_WORKER flag to ignore signals

2021-11-21 Thread Mike Christie
From: Christian Brauner Since this is mirroring kthread's sig ignore api introduced in commit 10ab825bdef8 ("change kernel threads to ignore signals instead of blocking them") this patch adds an option flag, KERNEL_WORKER_SIG_IGN, handled in copy_process() after copy_sighand() and copy_signals(

[PATCH V5 03/10] fork: add KERNEL_WORKER flag to not dup/clone files

2021-11-21 Thread Mike Christie
Each vhost device gets a thread that is used to perform IO and management operations. Instead of a thread that is accessing a device, the thread is part of the device, so when it calls the kernel_worker() function added in the next patch we can't dup or clone the parent's files/FDS because it would

[PATCH V5 01/10] fork: Make IO worker options flag based

2021-11-21 Thread Mike Christie
This patchset adds a couple new options to kernel_clone_args for IO thread like/related users. Instead of adding new fields to kernel_clone_args for each option, this moves us to a flags based approach by first converting io_thread. Signed-off-by: Mike Christie Suggested-by: Christian Brauner Ac

[PATCH V5 10/10] vhost: use kernel_worker to check RLIMITs

2021-11-21 Thread Mike Christie
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. This patch has us use the kernel_copy_process function which will inherit its values/checks from the thread that owns the device. Signed

[PATCH V5 08/10] fork: remove create_io_thread

2021-11-21 Thread Mike Christie
create_io_thread is not used anymore so remove it. Signed-off-by: Mike Christie --- include/linux/sched/task.h | 1 - kernel/fork.c | 22 -- 2 files changed, 23 deletions(-) diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 2188be3a3142

[PATCH V5 07/10] io_uring: switch to kernel_worker

2021-11-21 Thread Mike Christie
Convert io_uring and io-wq to use kernel_worker. Signed-off-by: Mike Christie Reviewed-by: Christian Brauner Reviewed-by: Jens Axboe Reviewed-by: Christoph Hellwig --- fs/io-wq.c| 15 --- fs/io_uring.c | 11 +-- 2 files changed, 13 insertions(+), 13 deletions(-) diff

[PATCH V5 06/10] fork: add helper to clone a process

2021-11-21 Thread Mike Christie
The vhost layer has similar requirements as io_uring where its worker threads need to access the userspace thread's memory, want to inherit the parents's cgroups and namespaces, and be checked against the parent's RLIMITs. Right now, the vhost layer uses the kthread API which has kthread_use_mm for

[PATCH V5 09/10] vhost: move worker thread fields to new struct

2021-11-21 Thread Mike Christie
This is just a prep patch. It moves the worker related fields to a new vhost_worker struct and moves the code around to create some helpers that will be used in the next patch. Signed-off-by: Mike Christie Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin Reviewed-by: Christoph Hellwig

[PATCH V5 00/10] Use copy_process/create_io_thread in vhost layer

2021-11-21 Thread Mike Christie
The following patches made over Linus's tree, allow the vhost layer to do a copy_process on the thread that does the VHOST_SET_OWNER ioctl like how io_uring does a copy_process against its userspace app. This allows the vhost layer's worker threads to inherit cgroups, namespaces, address space, etc

Re: [PATCH V5 07/10] io_uring: switch to kernel_worker

2021-11-21 Thread Jens Axboe
On 11/21/21 10:49 AM, Mike Christie wrote: > Convert io_uring and io-wq to use kernel_worker. I don't like the kernel_worker name, that implies it's always giving you a kernel thread or kthread. That's not the io_uring use case, it's really just a thread off the original task that just happens to

Re: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit wrote: > > > > > From: Jason Wang > > Sent: Friday, November 19, 2021 8:12 AM > > > > On Thu, Nov 18, 2021 at 1:58 PM Eli Cohen wrote: > > > > > > Add support for querying virtqueue statistics. Supported statistics are: > > > > > > Received_desc - nu

Re: [PATCH 6/6] vhost_net: use RCU callbacks instead of synchronize_rcu()

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 7:31 PM Andrey Ryabinin wrote: > > > > On 11/16/21 8:00 AM, Jason Wang wrote: > > On Mon, Nov 15, 2021 at 11:32 PM Andrey Ryabinin > > wrote: > >> > >> Currently vhost_net_release() uses synchronize_rcu() to synchronize > >> freeing with vhost_zerocopy_callback(). However

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 11:10 PM Halil Pasic wrote: > > On Wed, 27 Oct 2021 10:21:04 +0800 > Jason Wang wrote: > > > This patch validate the used buffer length provided by the device > > before trying to use it. This is done by record the in buffer length > > in a new field in desc_state structur

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Halil Pasic
On Mon, 22 Nov 2021 11:51:09 +0800 Jason Wang wrote: > On Fri, Nov 19, 2021 at 11:10 PM Halil Pasic wrote: > > > > On Wed, 27 Oct 2021 10:21:04 +0800 > > Jason Wang wrote: > > > > > This patch validate the used buffer length provided by the device > > > before trying to use it. This is done b

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Halil Pasic
On Mon, 22 Nov 2021 06:35:18 +0100 Halil Pasic wrote: > > I think it should be a common issue, looking at > > vhost_vsock_handle_tx_kick(), it did: > > > > len += sizeof(pkt->hdr); > > vhost_add_used(vq, head, len); > > > > which looks like a violation of the spec since it's TX. > > I'm not

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Jason Wang
On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > On Mon, 22 Nov 2021 06:35:18 +0100 > Halil Pasic wrote: > > > > I think it should be a common issue, looking at > > > vhost_vsock_handle_tx_kick(), it did: > > > > > > len += sizeof(pkt->hdr); > > > vhost_add_used(vq, head, len); > > > > > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Stefano Garzarella
On Mon, Nov 22, 2021 at 11:51:09AM +0800, Jason Wang wrote: On Fri, Nov 19, 2021 at 11:10 PM Halil Pasic wrote: On Wed, 27 Oct 2021 10:21:04 +0800 Jason Wang wrote: > This patch validate the used buffer length provided by the device > before trying to use it. This is done by record the in bu

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Stefano Garzarella
On Mon, Nov 22, 2021 at 02:25:26PM +0800, Jason Wang wrote: On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: On Mon, 22 Nov 2021 06:35:18 +0100 Halil Pasic wrote: > > I think it should be a common issue, looking at > > vhost_vsock_handle_tx_kick(), it did: > > > > len += sizeof(pkt->hdr);