Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Dave Chinner via Virtualization
On Thu, Jun 22, 2023 at 05:12:02PM +0200, Vlastimil Babka wrote: > On 6/22/23 10:53, Qi Zheng wrote: > > @@ -1067,33 +1068,27 @@ static unsigned long shrink_slab(gfp_t gfp_mask, > > int nid, > > if (!mem_cgroup_disabled() && !mem_cgroup_is_root(memcg)) > > return shrink_slab_memcg(

Re: [PATCH 02/29] mm: vmscan: introduce some helpers for dynamically allocating shrinker

2023-06-22 Thread Dave Chinner via Virtualization
On Thu, Jun 22, 2023 at 04:53:08PM +0800, Qi Zheng wrote: > Introduce some helpers for dynamically allocating shrinker instance, > and their uses are as follows: > > 1. shrinker_alloc_and_init() > > Used to allocate and initialize a shrinker instance, the priv_data > parameter is used to pass the

Re: [PATCH] block: virtio-blk: Fix handling of zone append command completion

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 23, 2023 at 06:55:24AM +0900, Damien Le Moal wrote: > On 6/22/23 23:32, Suwan Kim wrote: > > On Tue, Jun 20, 2023 at 5:39 PM Damien Le Moal wrote: > >> > >> The introduction of completion batching with commit 07b679f70d73 > >> ("virtio-blk: support completion batching for the IRQ path"

[PATCH v2] vduse: fix NULL pointer dereference

2023-06-22 Thread Maxime Coquelin
vduse_vdpa_set_vq_affinity callback can be called with NULL value as cpu_mask when deleting the vduse device. This patch resets virtqueue's IRQ affinity mask value to set all CPUs instead of dereferencing NULL cpu_mask. [ 4760.952149] BUG: kernel NULL pointer dereference, address: 000

Re: [PATCH vhost v10 00/10] virtio core prepares for AF_XDP

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 02, 2023 at 05:21:56PM +0800, Xuan Zhuo wrote: > ## About DMA APIs > > Now, virtio may can not work with DMA APIs when virtio features do not have > VIRTIO_F_ACCESS_PLATFORM. > > 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs > just >work with the "r

Re: [PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 02, 2023 at 05:22:01PM +0800, Xuan Zhuo wrote: > Under the premapped mode, the driver needs to unmap the DMA address > after receiving the buffer. The virtio core records the DMA address, > so the driver needs a way to get the dma info from the virtio core. > > A straightforward approa

Re: [PATCH vhost v10 07/10] virtio_ring: introduce helpers for premapped

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 02, 2023 at 05:22:03PM +0800, Xuan Zhuo wrote: > This patch introduces three helpers for premapped mode. > > * virtqueue_get_buf_premapped > * virtqueue_detach_unused_buf_premapped > > The above helpers work like the non-premapped funcs. But a cursor is > passed. > > virtqueue_detach

Re: [PATCH v2] Revert "virtio-blk: support completion batching for the IRQ path"

2023-06-22 Thread Michael S. Tsirkin
On Tue, Jun 20, 2023 at 10:54:19PM +, Edward Liaw wrote: > On Fri, Jun 09, 2023 at 03:27:24AM -0400, Michael S. Tsirkin wrote: > > This reverts commit 07b679f70d73483930e8d3c293942416d9cd5c13. > This commit was also breaking kernel tests on a virtual Android device > (cuttlefish). We were seei

Re: [PATCH RFC net-next v4 7/8] vsock: Add lockless sendmsg() support

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:34AM +, Bobby Eshleman wrote: Because the dgram sendmsg() path for AF_VSOCK acquires the socket lock it does not scale when many senders share a socket. Prior to this patch the socket lock is used to protect both reads and writes to the local_addr, remote_addr,

Re: [PATCH RFC net-next v4 6/8] virtio/vsock: support dgrams

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:33AM +, Bobby Eshleman wrote: This commit adds support for datagrams over virtio/vsock. Message boundaries are preserved on a per-skb and per-vq entry basis. Messages are copied in whole from the user to an SKB, which in turn is added to the scatterlist for the

Re: [PATCH RFC net-next v4 6/8] virtio/vsock: support dgrams

2023-06-22 Thread Stefano Garzarella
On Sun, Jun 11, 2023 at 11:49:02PM +0300, Arseniy Krasnov wrote: Hello Bobby! On 10.06.2023 03:58, Bobby Eshleman wrote: This commit adds support for datagrams over virtio/vsock. Message boundaries are preserved on a per-skb and per-vq entry basis. I'm a little bit confused about the followi

Re: [PATCH RFC net-next v4 5/8] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:32AM +, Bobby Eshleman wrote: This commit adds a feature bit for virtio vsock to support datagrams. Signed-off-by: Jiang Wang Signed-off-by: Bobby Eshleman --- include/uapi/linux/virtio_vsock.h | 1 + 1 file changed, 1 insertion(+) LGTM, but I'll give the R-b

Re: [PATCH RFC net-next v4 4/8] vsock: make vsock bind reusable

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:31AM +, Bobby Eshleman wrote: This commit makes the bind table management functions in vsock usable for different bind tables. For use by datagrams in a future patch. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/af_vsock.c | 33 ++

Re: [PATCH RFC net-next v4 3/8] vsock: support multi-transport datagrams

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:30AM +, Bobby Eshleman wrote: This patch adds support for multi-transport datagrams. This includes: - Per-packet lookup of transports when using sendto(sockaddr_vm) - Selecting H2G or G2H transport using VMADDR_FLAG_TO_HOST and CID in sockaddr_vm To preserve b

Re: [PATCH 24/29] mm: vmscan: make global slab shrink lockless

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > The shrinker_rwsem is a global read-write lock in > shrinkers subsystem, which protects most operations > such as slab shrink, registration and unregistration > of shrinkers, etc. This can easily cause problems in > the following cases. > > 1) When the memory pr

Re: [PATCH RFC net-next v4 2/8] vsock: refactor transport lookup code

2023-06-22 Thread Stefano Garzarella
On Sat, Jun 10, 2023 at 12:58:29AM +, Bobby Eshleman wrote: Introduce new reusable function vsock_connectible_lookup_transport() that performs the transport lookup logic. No functional change intended. Signed-off-by: Bobby Eshleman --- net/vmw_vsock/af_vsock.c | 25 ++--

Re: [PATCH 29/29] mm: shrinker: move shrinker-related code into a separate file

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > The mm/vmscan.c file is too large, so separate the shrinker-related > code from it into a separate file. No functional changes. > > Signed-off-by: Qi Zheng Maybe do this move as patch 01 so the further changes are done in the new file already? ___

Re: [PATCH RFC net-next v4 1/8] vsock/dgram: generalize recvmsg and drop transport->dgram_dequeue

2023-06-22 Thread Stefano Garzarella
On Sun, Jun 11, 2023 at 11:43:15PM +0300, Arseniy Krasnov wrote: Hello Bobby! Thanks for this patchset! Small comment below: On 10.06.2023 03:58, Bobby Eshleman wrote: This commit drops the transport->dgram_dequeue callback and makes vsock_dgram_recvmsg() generic. It also adds additional transp

Re: [PATCH 01/29] mm: shrinker: add shrinker::private_data field

2023-06-22 Thread Vlastimil Babka
On 6/22/23 10:53, Qi Zheng wrote: > To prepare for the dynamic allocation of shrinker instances > embedded in other structures, add a private_data field to > struct shrinker, so that we can use shrinker::private_data > to record and get the original embedded structure. > > Signed-off-by: Qi Zheng

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-22 Thread Stefano Garzarella
On Thu, Jun 22, 2023 at 07:37:08AM -0400, Michael S. Tsirkin wrote: On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support packed virtqueue well yet, so let's filter the VIRTIO_F_RING_PACKED feature for

Re: [PATCH vhost v10 10/10] virtio_net: support dma premapped

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 02, 2023 at 05:22:06PM +0800, Xuan Zhuo wrote: > Introduce the module param "experiment_premapped" to enable the function > that the virtio-net do dma mapping. > > If that is true, the vq of virtio-net is under the premapped mode. > It just handle the sg with dma_address. And the drive

Re: [PATCH 0/3] fixup potential cpu stall

2023-06-22 Thread Michael S. Tsirkin
On Fri, Jun 09, 2023 at 09:18:14PM +0800, Xianting Tian wrote: > Cpu stall issue may happen if device is configured with multi queues > and large queue depth, so fix it. I applied this after tweaking commit log to address Greg's comments. In the future I expect you guys to do such tweaks yourself

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-22 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > don't support packed virtqueue well yet, so let's filter the > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). > > This way, even if the dev