Re: Re: PING: [PATCH v5 0/2] misc: pvpanic: introduce capability & event attribute

2021-01-20 Thread zhenwei pi
On 1/21/21 1:53 AM, Greg KH wrote: X-Gm-Spam: 0 X-Gm-Phishy: 0 On Mon, Jan 18, 2021 at 09:42:57AM +0800, zhenwei pi wrote: Hi, Greg What's the next step I should take? I need some reviews by the people who will be doing the qemu portion of this, or someone else, please. thanks, greg k-h

PING: [PATCH v5 0/2] misc: pvpanic: introduce capability & event attribute

2021-01-17 Thread zhenwei pi
Hi, Greg What's the next step I should take? On 1/10/21 7:53 PM, zhenwei pi wrote: v4 -> v5: Use sysfs_emit to export attribute value. Only allow subset of capability to set on events. Add more detailed infomation in document. v3 -> v4: Use event sysfs attribute instead of module par

[PATCH v3] nvmet: fix uninitialized work for zero kato

2020-10-14 Thread zhenwei pi
in 0d3b6a8d213a), ka_work still has a chance to run (called by nvmet_start_ctrl). Fixes: 0d3b6a8d213a ("nvmet: Disable keep-alive timer when kato is cleared to 0h") Signed-off-by: zhenwei pi --- drivers/nvme/target/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dr

[PATCH] block: add io_error stat for block device

2020-09-09 Thread zhenwei pi
Currently if hitting block req error, block layer only prints error log with a rate limitation. Then agent has to parse kernel log to record what happens. In this patch, add read/write/discard/flush stat counter to record io errors. Signed-off-by: zhenwei pi --- block/blk-core.c | 14

[PATCH] nvmet: fix mismatched serial

2020-12-10 Thread zhenwei pi
. Signed-off-by: zhenwei pi --- drivers/nvme/target/configfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index 37e1d7784e17..e7808a86ccef 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme

[PATCH v2] nvmet: fix mismatched serial

2020-12-12 Thread zhenwei pi
side, and run 'nvme id-ctrl /dev/nvme0' on initiator side, then we can get the same SN string. Signed-off-by: zhenwei pi Reported-by: kernel test robot --- drivers/nvme/target/configfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/configfs.c b

[PATCH v2] nvme-rdma: handle nvme completion data length

2020-10-23 Thread zhenwei pi
received from target, and the host side continues to process without length checking, then the previous CQE is processed twice. Handle data length, ignore zero bytes message, and try to recovery for corrupted CQE case. Thanks to Chao Leng for suggestions. Signed-off-by: zhenwei pi --- drivers/nvme

[PATCH v3] nvme-rdma: handle nvme completion data length

2020-10-25 Thread zhenwei pi
connections on transport layer is not standard, currently still treat it as illegal. Thanks to Chao Leng & Sagi for suggestions. Signed-off-by: zhenwei pi --- drivers/nvme/host/rdma.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c i

PING: [PATCH] block: add io_error stat for block device

2020-10-21 Thread zhenwei pi
Hi, Jens What do you think about this, adding io error stat for block devices is reasonable? On 9/10/20 10:20 AM, zhenwei pi wrote: Currently if hitting block req error, block layer only prints error log with a rate limitation. Then agent has to parse kernel log to record what happens

[PATCH] nvme-rdma: handle nvme completion data length

2020-10-22 Thread zhenwei pi
received from target, and the host side continues to process without length checking, then the previous CQE is processed twice. Handle data length, ignore zero bytes message, and try to recovery for corrupted CQE case. Signed-off-by: zhenwei pi --- drivers/nvme/host/rdma.c | 11 +++ 1 file

Re: [External] Re: [PATCH] nvme-rdma: handle nvme completion data length

2020-10-22 Thread zhenwei pi
On 10/22/20 5:55 PM, Chao Leng wrote: On 2020/10/22 16:38, zhenwei pi wrote: Hit a kernel warning: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 0 at lib/refcount.c:28 RIP: 0010:refcount_warn_saturate+0xd9/0xe0 Call Trace:     nvme_rdma_recv_done+0xf3/0x280 [nvme_rdma

[PATCH 1/2] nvmet: introduce transport layer keep-alive

2020-10-27 Thread zhenwei pi
In the zero KATO scenario, if initiator crashes without transport layer disconnection, target side would never reclaim resources. A target could start transport layer keep-alive to detect dead connection for the admin queue. Signed-off-by: zhenwei pi --- drivers/nvme/target/admin-cmd.c | 2

[PATCH 2/2] nvmet-tcp: add keep-alive

2020-10-27 Thread zhenwei pi
Add tcp keep-alive to detect dead connections for zero KATO case. Signed-off-by: zhenwei pi --- drivers/nvme/target/tcp.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index dc1f0f647189..58800e914e61 100644

PING: [PATCH] block: add io_error stat for block device

2020-09-24 Thread zhenwei pi
Hi, Jens How do you think about error stat of a block device? On 9/10/20 10:20 AM, zhenwei pi wrote: Currently if hitting block req error, block layer only prints error log with a rate limitation. Then agent has to parse kernel log to record what happens. In this patch, add read/write/discard

Re: [External] Re: [PATCH 1/2] nvmet: introduce transport layer keep-alive

2020-10-28 Thread zhenwei pi
On 10/28/20 3:15 PM, Sagi Grimberg wrote: On 10/27/20 5:15 AM, zhenwei pi wrote: In the zero KATO scenario, if initiator crashes without transport layer disconnection, target side would never reclaim resources. A target could start transport layer keep-alive to detect dead connection

[PATCH] nvmet: fix uninitialized work for zero kato

2020-10-12 Thread zhenwei pi
in 0d3b6a8d213a), ka_work still has a chance to run (called by nvmet_start_ctrl to detect dead host). Initilize ka_work during allocating ctrl, and set a reasonable kato before scheduling ka_work. Signed-off-by: zhenwei pi --- drivers/nvme/target/core.c | 16 +++- 1 file changed, 11

[PATCH v2] nvmet: fix uninitialized work for zero kato

2020-10-14 Thread zhenwei pi
in 0d3b6a8d213a), ka_work still has a chance to run (called by nvmet_start_ctrl). Fixes: Don't run keep alive work with zero kato. Signed-off-by: zhenwei pi --- drivers/nvme/target/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target

Re: [External] [PATCH] misc: pvpanic: sysfs_emit uses should have a newline

2021-01-31 Thread zhenwei pi
char *buf) { - return sysfs_emit(buf, "%x", events); + return sysfs_emit(buf, "%x\n", events); } static ssize_t events_store(struct device *dev, struct device_attribute *attr, Hi, Greg is the maintainer of this driver. -- zhenwei pi

Re: [PATCH] misc: pvpanic: sysfs_emit uses should have a newline

2021-02-03 Thread zhenwei pi
On 2/3/21 10:57 PM, Greg Kroah-Hartman wrote: On Mon, Feb 01, 2021 at 09:56:57AM +0800, zhenwei pi wrote: On 1/30/21 3:08 AM, Joe Perches wrote: Add newline terminations to the sysfs_emit uses added by -next commit 8d6da6575ffe ("misc: pvpanic: introduce events device attribue")

[PATCH] sched: idle: Support nohlt_list kernel parameter

2019-05-22 Thread zhenwei pi
CPUs still halt in idle. We can config boot parameter in guest(Ex, 16vCPUs on x86) like this: linux ... irqaffinity=0,2,4,6 nohlt_list=0,2,4,6 it means that 25% of CPUs can always run in vm-mode and benefit from posted-interrupt. Signed-off-by: zhenwei pi --- kernel/sched/idle.c | 35

[PATCH] fs/proc: add short desc for /proc/softirqs

2020-07-01 Thread zhenwei pi
short desc for /proc/softirqs in this patch, then /proc/softirqs gets more human-readable. Signed-off-by: zhenwei pi --- fs/proc/softirqs.c| 2 +- include/linux/interrupt.h | 5 +++-- kernel/softirq.c | 12 3 files changed, 16 insertions(+), 3 deletions(-) diff

[PATCH v2] misc: pvpanic: introduce device capability

2021-01-08 Thread zhenwei pi
sending event to host side, check capability firstly. Suggested by Paolo, export capability of pvpanic device by read-only module parameter. Signed-off-by: zhenwei pi --- drivers/misc/pvpanic.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/misc

[PATCH v3 1/2] misc: pvpanic: introduce device capability

2021-01-08 Thread zhenwei pi
sending event to host side, check capability firstly. Suggested by Greg KH, use sysfs to expose capability to user space. Signed-off-by: zhenwei pi --- .../ABI/testing/sysfs-bus-pci-devices-pvpanic | 7 drivers/misc/pvpanic.c| 41 --- 2 files changed

[PATCH v3 0/2] misc: pvpanic: introduce capability & module parameter

2021-01-08 Thread zhenwei pi
before kicking host side, check the event is supported or not. zhenwei pi (2): misc: pvpanic: introduce device capability misc: pvpanic: introduce module parameter 'events' drivers/misc/pvpanic.c | 45 -- 1 file changed, 39 insertions(+), 6 deletions(-) -- 2.25.1

[PATCH v3 2/2] misc: pvpanic: introduce module parameter 'events'

2021-01-08 Thread zhenwei pi
Suggested by Paolo, add a module parameter that can be used to limit which capabilities the driver uses. Finally, the pvpanic guest driver works by the limitation of both device capability and user setting. Signed-off-by: zhenwei pi --- drivers/misc/pvpanic.c | 6 +- 1 file changed, 5

Re: [External] Re: [PATCH v3 2/2] misc: pvpanic: introduce module parameter 'events'

2021-01-09 Thread zhenwei pi
if this ever becomes not true, the module parameter is a mess... thanks, greg k-h What about adding _two_ device attribute: capability (0444): detect from device which the hypervisor really supports. events (0644): root user could enable/disable feature(s) from guest side. -- zhenwei pi

[PATCH v4 0/2] misc: pvpanic: introduce capability & event attribute

2021-01-09 Thread zhenwei pi
2: Remove device info log, use module parameter to expose capability. v1: The guest sides determines pvpanic capability by RDPT, before kicking host side, check the event is supported or not. zhenwei pi (2): misc: pvpanic: introduce device capability misc: pvpanic: introduce module paramete

[PATCH v4 1/2] misc: pvpanic: introduce device capability

2021-01-09 Thread zhenwei pi
sending event to host side, check capability firstly. Suggested by Greg KH, use sysfs to expose capability to user space, also add new sysfs attribute in document. Signed-off-by: zhenwei pi --- .../ABI/testing/sysfs-bus-pci-devices-pvpanic | 7 drivers/misc/pvpanic.c

[PATCH v4 2/2] misc: pvpanic: introduce events device attribue

2021-01-09 Thread zhenwei pi
Suggested by Paolo & Greg, add 'events' device attribute that can be used to limit which capabilities the driver uses. Finally, the pvpanic guest driver works by the limitation of both device capability and user setting. Signed-off-by: zhenwei pi --- .../ABI/testing/sysfs-bus-pci-dev

[PATCH v5 1/2] misc: pvpanic: introduce device capability

2021-01-10 Thread zhenwei pi
sending event to host side, check capability firstly. Suggested by Greg KH, use sysfs to expose capability to user space, also add new sysfs attribute in document. Signed-off-by: zhenwei pi --- .../ABI/testing/sysfs-bus-pci-devices-pvpanic | 12 +++ drivers/misc/pvpanic.c

[PATCH v5 2/2] misc: pvpanic: introduce events device attribue

2021-01-10 Thread zhenwei pi
Suggested by Paolo & Greg, add 'events' device attribute that can be used to limit which capabilities the driver uses. Finally, the pvpanic guest driver works by the limitation of both device capability and user setting. Signed-off-by: zhenwei pi --- .../ABI/testing/sysfs-bus-pci-dev

[PATCH v5 0/2] misc: pvpanic: introduce capability & event attribute

2021-01-10 Thread zhenwei pi
side, check the event is supported or not. zhenwei pi (2): misc: pvpanic: introduce device capability misc: pvpanic: introduce module parameter 'events' .../ABI/testing/sysfs-bus-pci-devices-pvpanic | 14 + drivers/misc/pvpanic.c| 58 +-- 2 files

[PATCH v2 3/4] virtio_balloon: introduce memory allocation stall counter

2024-04-22 Thread zhenwei pi
Memory allocation stall counter represents the performance/latency of memory allocation, expose this counter to the host side by virtio balloon device via out-of-bound way. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 8 include/uapi/linux/virtio_balloon.h | 6

[PATCH v2 4/4] virtio_balloon: introduce memory scan/reclaim info

2024-04-22 Thread zhenwei pi
more memory, but it can't. Once more memory is required in future, it will struggle to reclaim memory. Acked-by: David Hildenbrand Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 9 + include/uapi/linux/virtio_balloon.h | 12 ++-- 2 files changed, 19

Re: Re: [PATCH v2 1/4] virtio_balloon: separate vm events into a function

2024-04-22 Thread zhenwei pi
On 4/22/24 15:47, David Hildenbrand wrote: On 22.04.24 09:42, zhenwei pi wrote: All the VM events related statistics have dependence on 'CONFIG_VM_EVENT_COUNTERS', once any stack variable is required by any VM events in future, we would have codes like:   #ifdef CONFIG_VM_EVENT_COUNTERS

[PATCH v2 2/4] virtio_balloon: introduce oom-kill invocations

2024-04-22 Thread zhenwei pi
grep for magic words in guest kernel log from host side. Rather than this unstable way, virtio balloon reports OOM-KILL invocations instead. Acked-by: David Hildenbrand Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 1 + include/uapi/linux/virtio_balloon.h | 6 -- 2

[PATCH v2 0/4] Improve memory statistics for virtio balloon

2024-04-22 Thread zhenwei pi
-> v1: - several text changes: oom-kill -> oom-kills, SCAN_ASYNC -> ASYN_SCAN. - move vm events codes into '#ifdef CONFIG_VM_EVENT_COUNTERS' RFC version: Link: https://lore.kernel.org/lkml/20240415084113.1203428-1-pizhen...@bytedance.com/T/#m1898963b3c27a989b1123db475135c3ca687ca84

[PATCH v2 1/4] virtio_balloon: separate vm events into a function

2024-04-22 Thread zhenwei pi
= events[XXX] + events[YYY]; update_stat(vb, idx++, VIRTIO_BALLOON_S_XXX, foo); #endif Separate vm events into a single function, also remove 'CONFIG_VM_EVENT_COUNTERS' from 'update_balloon_stats'. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 44

[PATCH v3 3/4] virtio_balloon: introduce memory allocation stall counter

2024-04-22 Thread zhenwei pi
Memory allocation stall counter represents the performance/latency of memory allocation, expose this counter to the host side by virtio balloon device via out-of-bound way. Acked-by: David Hildenbrand Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 8 include/uapi

[PATCH v3 4/4] virtio_balloon: introduce memory scan/reclaim info

2024-04-22 Thread zhenwei pi
more memory, but it can't. Once more memory is required in future, it will struggle to reclaim memory. Acked-by: David Hildenbrand Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 9 + include/uapi/linux/virtio_balloon.h | 12 ++-- 2 files changed, 19

[PATCH v3 2/4] virtio_balloon: introduce oom-kill invocations

2024-04-22 Thread zhenwei pi
grep for magic words in guest kernel log from host side. Rather than this unstable way, virtio balloon reports OOM-KILL invocations instead. Acked-by: David Hildenbrand Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 1 + include/uapi/linux/virtio_balloon.h | 6 -- 2

[PATCH v3 1/4] virtio_balloon: separate vm events into a function

2024-04-22 Thread zhenwei pi
All the VM events related statistics have dependence on 'CONFIG_VM_EVENT_COUNTERS', separate these events into a function to make code clean. Then we can remove 'CONFIG_VM_EVENT_COUNTERS' from 'update_balloon_stats'. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 43

[PATCH v3 0/4] Improve memory statistics for virtio balloon

2024-04-22 Thread zhenwei pi
re.kernel.org/lkml/20240415084113.1203428-1-pizhen...@bytedance.com/T/#m1898963b3c27a989b1123db475135c3ca687ca84 zhenwei pi (4): virtio_balloon: separate vm events into a function virtio_balloon: introduce oom-kill invocations virtio_balloon: introduce memory allocation stall counter virtio_

Re: Re: [RFC 0/3] Improve memory statistics for virtio balloon

2024-04-15 Thread zhenwei pi
On 4/15/24 23:01, David Hildenbrand wrote: On 15.04.24 10:41, zhenwei pi wrote: Hi, When the guest runs under critial memory pressure, the guest becomss too slow, even sshd turns D state(uninterruptible) on memory allocation. We can't login this VM to do any work on trouble shooting. Guest

[RFC 3/3] virtio_balloon: introduce memory scan/reclaim info

2024-04-15 Thread zhenwei pi
more memory, but it can't. Once more memory is required in future, it will struggle to reclaim memory. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 9 + include/uapi/linux/virtio_balloon.h | 12 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff

[RFC 2/3] virtio_balloon: introduce memory allocation stall counter

2024-04-15 Thread zhenwei pi
Memory allocation stall counter represents the performance/latency of memory allocation, expose this counter to the host side by virtio balloon device via out-of-bound way. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 19 ++- include/uapi/linux

[RFC 1/3] virtio_balloon: introduce oom-kill invocations

2024-04-15 Thread zhenwei pi
grep for magic words in guest kernel log from host side. Rather than this unstable way, virtio balloon reports OOM-KILL invocations instead. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 2 ++ include/uapi/linux/virtio_balloon.h | 6 -- 2 files changed, 6 insertions

[RFC 0/3] Improve memory statistics for virtio balloon

2024-04-15 Thread zhenwei pi
more memory is required in future, it will struggle to reclaim memory. zhenwei pi (3): virtio_balloon: introduce oom-kill invocations virtio_balloon: introduce memory allocation stall counter virtio_balloon: introduce memory scan/reclaim info drivers/virtio/virtio_balloon.c | 30

[PATCH 2/3] virtio_balloon: introduce memory allocation stall counter

2024-04-18 Thread zhenwei pi
Memory allocation stall counter represents the performance/latency of memory allocation, expose this counter to the host side by virtio balloon device via out-of-bound way. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 20 +++- include/uapi/linux

[PATCH 0/3] Improve memory statistics for virtio balloon

2024-04-18 Thread zhenwei pi
RFC -> v1: - several text changes: oom-kill -> oom-kills, SCAN_ASYNC -> ASYN_SCAN. - move vm events codes into '#ifdef CONFIG_VM_EVENT_COUNTERS' RFC version: Link: https://lore.kernel.org/lkml/20240415084113.1203428-1-pizhen...@bytedance.com/T/#m1898963b3c27a989b1123db475135c3ca687ca84

[PATCH 1/3] virtio_balloon: introduce oom-kill invocations

2024-04-18 Thread zhenwei pi
grep for magic words in guest kernel log from host side. Rather than this unstable way, virtio balloon reports OOM-KILL invocations instead. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 1 + include/uapi/linux/virtio_balloon.h | 6 -- 2 files changed, 5 insertions(+), 2

[PATCH 3/3] virtio_balloon: introduce memory scan/reclaim info

2024-04-18 Thread zhenwei pi
more memory, but it can't. Once more memory is required in future, it will struggle to reclaim memory. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 9 + include/uapi/linux/virtio_balloon.h | 12 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff

Re: Re: [PATCH v3 2/4] virtio_balloon: introduce oom-kill invocations

2024-04-23 Thread zhenwei pi
On 4/23/24 17:13, Michael S. Tsirkin wrote: On Tue, Apr 23, 2024 at 11:41:07AM +0800, zhenwei pi wrote: [snip] #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ Looks like a useful extension. Bu