[PATCH] PCI: hv: Fix a race condition when removing the device

2021-04-19 Thread longli
From: Long Li On removing the device, any work item (hv_pci_devices_present() or hv_pci_eject_device()) scheduled on workqueue hbus->wq may still be running and race with hv_pci_remove(). This can happen because the host may send PCI_EJECT or PCI_BUS_RELATIONS(2) and decide to rescind the

[PATCH 1/7] cifs: Don't display RDMA transport on reconnect

2019-10-16 Thread longli
From: Long Li On reconnect, the transport data structure is NULL and its information is not available. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/cifs_debug.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index

[PATCH 0/7] cifs: smbd: Improve reliability on transport reconnect

2019-10-16 Thread longli
From: Long Li Long Li (7): cifs: Don't display RDMA transport on reconnect cifs: smbd: Invalidate and deregister memory registration on re-send cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE cifs: smbd: Add messages on RDMA session destroy and

[PATCH 2/7] cifs: smbd: Invalidate and deregister memory registration on re-send

2019-10-16 Thread longli
From: Long Li On re-send, there might be a reconnect and all prevoius memory registrations need to be invalidated and deregistered. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/file.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git

[PATCH 5/7] cifs: smbd: Return -ECONNABORTED when trasnport is not in connected state

2019-10-16 Thread longli
From: Long Li The transport should return this error so the upper layer will reconnect. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/smbdirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index

[PATCH 6/7] cifs: smbd: Only queue work for error recovery on memory registration

2019-10-16 Thread longli
From: Long Li It's not necessary to queue invalidated memory registration to work queue, as all we need to do is to unmap the SG and make it usable again. This can save CPU cycles in normal data paths as memory registration errors are rare and normally only happens during reconnection.

[PATCH 4/7] cifs: smbd: Add messages on RDMA session destroy and reconnection

2019-10-16 Thread longli
From: Long Li Log these activities to help production support. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/smbdirect.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index d41a9345f90d..227ef51c0712 100644

[PATCH 7/7] cifs: smbd: Return -EAGAIN when transport is reconnecting

2019-10-16 Thread longli
From: Long Li During reconnecting, the transport may have already been destroyed and is in the process being reconnected. In this case, return -EAGAIN to not fail and to retry this I/O. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/transport.c | 7 +-- 1 file changed, 5

[PATCH 3/7] cifs: smbd: Return -EINVAL when the number of iovs exceeds SMBDIRECT_MAX_SGE

2019-10-16 Thread longli
From: Long Li While it's not friendly to fail user processes that issue more iovs than we support, at least we should return the correct error code so the user process gets a chance to retry with smaller number of iovs. Signed-off-by: Long Li Cc: sta...@vger.kernel.org --- fs/cifs/smbdirect.c

[Patch v4] storvsc: setup 1:1 mapping between hardware queue and CPU queue

2019-09-06 Thread longli
From: Long Li storvsc doesn't use a dedicated hardware queue for a given CPU queue. When issuing I/O, it selects returning CPU (hardware queue) dynamically based on vmbus channel usage across all channels. This patch advertises num_present_cpus() as number of hardware queues. This will have

[Patch v3] storvsc: setup 1:1 mapping between hardware queue and CPU queue

2019-09-05 Thread longli
From: Long Li storvsc doesn't use a dedicated hardware queue for a given CPU queue. When issuing I/O, it selects returning CPU (hardware queue) dynamically based on vmbus channel usage across all channels. This patch advertises num_present_cpus() as number of hardware queues. This will have

[Patch v2] storvsc: setup 1:1 mapping between hardware queue and CPU queue

2019-08-22 Thread longli
From: Long Li storvsc doesn't use a dedicated hardware queue for a given CPU queue. When issuing I/O, it selects returning CPU (hardware queue) dynamically based on vmbus channel usage across all channels. This patch advertises num_possible_cpus() as number of hardware queues. This will have

[PATCH 3/3] nvme: complete request in work queue on CPU with flooded interrupts

2019-08-20 Thread longli
From: Long Li When a NVMe hardware queue is mapped to several CPU queues, it is possible that the CPU this hardware queue is bound to is flooded by returning I/O for other CPUs. For example, consider the following scenario: 1. CPU 0, 1, 2 and 3 share the same hardware queue 2. the hardware

[PATCH 1/3] sched: define a function to report the number of context switches on a CPU

2019-08-20 Thread longli
From: Long Li The number of context switches on a CPU is useful to determine how busy this CPU is on processing IRQs. Export this information so it can be used by device drivers. Signed-off-by: Long Li --- include/linux/sched.h | 1 + kernel/sched/core.c | 6 ++ 2 files changed, 7

[PATCH 0/3] fix interrupt swamp in NVMe

2019-08-20 Thread longli
From: Long Li This patch set tries to fix interrupt swamp in NVMe devices. On large systems with many CPUs, a number of CPUs may share one NVMe hardware queue. It may have this situation where several CPUs are issuing I/Os, and all the I/Os are returned on the CPU where the hardware queue is

[PATCH 2/3] sched: export idle_cpu()

2019-08-20 Thread longli
From: Long Li This function is useful for device drivers to check if this CPU has work to do in process context. Signed-off-by: Long Li --- include/linux/sched.h | 1 + kernel/sched/core.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h

[PATCH] storvsc: setup 1:1 mapping between hardware queue and CPU queue

2019-08-19 Thread longli
From: Long Li storvsc doesn't use a dedicated hardware queue for a given CPU queue. When issuing I/O, it selects returning CPU (hardware queue) dynamically based on vmbus channel usage across all channels. This patch sets up a 1:1 mapping between hardware queue and CPU queue, thus avoiding

[PATCH 2/2] cifs: Allocate memory for all iovs in smb2_ioctl

2019-05-15 Thread longli
From: Long Li An IOCTL uses up to 2 iovs. The 1st iov is the command itself, the 2nd iov is optional data for that command. The 1st iov is always allocated on the heap but the 2nd iov may point to a variable on the stack. This will trigger an error when passing the 2nd iov for RDMA I/O. Fix

[PATCH 1/2] cifs: Don't match port on SMBDirect transport

2019-05-15 Thread longli
From: Long Li SMBDirect manages its own ports in the transport layer, there is no need to check the port to find a connection. Signed-off-by: Long Li --- fs/cifs/connect.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index

[PATCH 1/2] cifs:smbd When reconnecting to server, call smbd_destroy() after all MIDs have been called

2019-05-13 Thread longli
From: Long Li commit 214bab448476 ("cifs: Call MID callback before destroying transport") assumes that the MID callback should not take srv_mutex, this may not always be true. SMB Direct requires the MID callback completed before calling transport so all pending memory registration can be freed.

[PATCH 2/2] cifs:smbd Use the correct DMA direction when sending data

2019-05-13 Thread longli
From: Long Li When sending data, use the DMA_TO_DEVICE to map buffers. Also log the number of requests in a compounding request from upper layer. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/cifs/smbdirect.c