Re: [PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-19 Thread Dongli Zhang
Hi Vitaly, Sean and David, On 10/19/23 08:40, Sean Christopherson wrote: > On Thu, Oct 19, 2023, Vitaly Kuznetsov wrote: >> Dongli Zhang writes: >> >>> As mentioned in the linux kernel development document, "sched_clock() is >>> used for scheduling and t

[PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-18 Thread Dongli Zhang
to old kernel version. References: [1] https://lore.kernel.org/all/20230926230649.67852-1-dongli.zh...@oracle.com/ [2] https://lore.kernel.org/all/20231018195638.1898375-1-sea...@google.com/ [3] https://lore.kernel.org/all/20231002211651.ga3...@noisy.programming.kicks-ass.net/ Thank you very much fo

Question on vhost vq->signalled_used and vq->signalled_used_valid

2022-06-14 Thread Dongli Zhang
y not use "vq->added_used" because the value is always updated after something is added to the vring buffer? Perhaps this is a silly question. Sorry that currently I am stuck on it :) Thank you very much! Dongli Zhang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH RFC v1 4/7] swiotlb: to implement io_tlb_high_mem

2022-06-10 Thread Dongli Zhang
'io_tlb_default_mem', but will not be able to know if it is allocated from 32-bit or 64-bit buffer. Thank you very much for the feedback. Dongli Zhang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.o

[PATCH RFC v1 0/7] swiotlb: extra 64-bit buffer for dev->dma_io_tlb_mem

2022-06-08 Thread Dongli Zhang
/kernel/debug/swiotlb/swiotlb-hi/io_tlb_nslabs 3145728 $ cat /sys/kernel/debug/swiotlb/swiotlb-hi/io_tlb_used 8960 Dongli Zhang (7): swiotlb: introduce the highmem swiotlb buffer swiotlb: change the signature of remap function swiotlb-xen: support highmem for xen specific code swiotlb: to imp

[PATCH RFC v1 7/7] swiotlb: fix the slot_addr() overflow

2022-06-08 Thread Dongli Zhang
lue smaller than the expected one. As a result, the swiotlb_bounce() will access a wrong swiotlb slot. Cc: Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- kernel/dma/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma

[PATCH RFC v1 3/7] swiotlb-xen: support highmem for xen specific code

2022-06-08 Thread Dongli Zhang
Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- drivers/xen/swiotlb-xen.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 339f46e21053..d15321e9f9db 100644 --- a/drivers/xen/swiotlb-xen.c +++ b

[PATCH RFC v1 1/7] swiotlb: introduce the highmem swiotlb buffer

2022-06-08 Thread Dongli Zhang
orce" is to allocate 64MB for default swiotlb, and 6GB for the extra highmem swiotlb. Cc: Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- include/linux/swiotlb.h | 2 ++ kernel/dma/swiotlb.c| 16 2 files changed, 18 insertions(+) diff --git a/include/l

[PATCH RFC v1 4/7] swiotlb: to implement io_tlb_high_mem

2022-06-08 Thread Dongli Zhang
Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/powerpc/kernel/dma-swiotlb.c | 8 ++- arch/x86/kernel/pci-dma.c | 5 +- include/linux/swiotlb.h | 2 +- kernel/dma/swiotlb.c | 103 +- 4 files changed, 84 insertions(+), 3

[PATCH RFC v1 2/7] swiotlb: change the signature of remap function

2022-06-08 Thread Dongli Zhang
Add new argument 'high' to remap function, so that it will be able to remap the swiotlb buffer based on whether the swiotlb is 32-bit or 64-bit. Currently the only remap function is xen_swiotlb_fixup(). Cc: Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/x86/include/asm/xen

[PATCH RFC v1 6/7] virtio: use io_tlb_high_mem if it is active

2022-06-08 Thread Dongli Zhang
When the swiotlb is enforced (e.g., when amd sev is involved), the virito driver will not be able to use 4+ GB memory. Therefore, the virtio driver uses 'io_tlb_high_mem' as swiotlb. Cc: Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- drivers/virtio/virtio.c | 8 1 file

[PATCH RFC v1 5/7] swiotlb: add interface to set dev->dma_io_tlb_mem

2022-06-08 Thread Dongli Zhang
The interface re-configures dev->dma_io_tlb_mem conditionally, if the 'io_tlb_high_mem' is active. Cc: Konrad Wilk Cc: Joe Jin Signed-off-by: Dongli Zhang --- include/linux/swiotlb.h | 6 ++ kernel/dma/swiotlb.c| 10 ++ 2 files changed, 16 insertions(+) diff --git a/incl

Re: [PATCH v3 1/2] virtio-blk: support polling I/O

2022-03-24 Thread Dongli Zhang
Hi Suwan, The NVMe prints something like below by nvme_setup_io_queues() to confirm if the configuration takes effect. "[ 0.620458] nvme nvme0: 4/0/0 default/read/poll queues". How about to print in virtio-blk as well? Thank you very much! Dongli Zhang On 3/24/22 7:04 AM, Suwan

Re: [PATCH 1/3] virtio: cache indirect desc for split

2021-10-27 Thread Dongli Zhang
E_CACHE_DESC_NUM) { > + if (vq->desc_cache_chain) { > + desc = vq->desc_cache_chain; > + vq->desc_cache_chain = (void *)desc->addr; > + goto got; > + } > + n = VIRT_QUEUE_CACHE_DESC

Re: [PATCH V2 06/12] virtio_pci: harden MSI-X interrupts

2021-10-19 Thread Dongli Zhang
On 10/18/21 6:33 PM, Jason Wang wrote: > On Sat, Oct 16, 2021 at 1:27 AM Michael S. Tsirkin wrote: >> >> On Fri, Oct 15, 2021 at 05:09:38AM -0700, Dongli Zhang wrote: >>> Hi Jason, >>> >>> On 10/11/21 11:52 PM, Jason Wang wrote: >>>>

Re: [PATCH V2 06/12] virtio_pci: harden MSI-X interrupts

2021-10-15 Thread Dongli Zhang
we detect hypervisor is malicious, the VM is panic/shutdown immediately. At least how about to print error message to reminder users. BTW, while I always do care about the loss of interrupt issue, the malicious device is able to hang a VM by dropping a single interrupt on purpose for virtio-scsi :) Th

Re: [RFC] virtio_scsi: to poll and kick the virtqueue in timeout handler

2021-05-25 Thread Dongli Zhang
On 5/25/21 10:24 AM, Hannes Reinecke wrote: > On 5/25/21 6:47 PM, Stefan Hajnoczi wrote: >> On Mon, May 24, 2021 at 11:33:33PM -0700, Dongli Zhang wrote: >>> On 5/24/21 6:24 AM, Stefan Hajnoczi wrote: >>>> On Sun, May 23, 2021 at 09:39:51AM +0200, Hannes Reinecke w

Re: [RFC] virtio_scsi: to poll and kick the virtqueue in timeout handler

2021-05-25 Thread Dongli Zhang
Hi Stefan and Hannes, On 5/24/21 6:24 AM, Stefan Hajnoczi wrote: > On Sun, May 23, 2021 at 09:39:51AM +0200, Hannes Reinecke wrote: >> On 5/23/21 8:38 AM, Dongli Zhang wrote: >>> This RFC is to trigger the discussion about to poll and kick the >>> virtqueue on pur

[RFC] virtio_scsi: to poll and kick the virtqueue in timeout handler

2021-05-23 Thread Dongli Zhang
. https://lore.kernel.org/linux-block/20210520141305.355961-1-stefa...@redhat.com/T/#t Thank you very much! Dongli Zhang Considering there might be loss of interrupt or kick issue, the timeout handler may poll or kick the virtqueue on purpose, in order to recover the IO. If the response

Re: [vdpa_sim_net] 79991caf52: net/ipv4/ipmr.c:#RCU-list_traversed_in_non-reader_section

2021-02-07 Thread Dongli Zhang
+0x22/0x30 Thank you very much! Dongli Zhang On 2/6/21 7:03 PM, kernel test robot wrote: > > Greeting, > > FYI, we noticed the following commit (built with gcc-9): > > commit: 79991caf5202c7989928be534727805f8f68bb8d ("vdpa_sim_net: Add support > for user s

Re: [PATCH v2 1/1] vhost scsi: alloc vhost_scsi with kvzalloc() to avoid delay

2021-01-23 Thread Dongli Zhang
According to my "git send-email" history, I have CCed jasow...@redhat.com. Not sure why Jason is not on the list. CCed Jason. Thank you very much! Dongli Zhang On 1/23/21 12:08 AM, Dongli Zhang wrote: > The size of 'struct vhost_scsi' is order-10 (~2.3MB). It may take long

[PATCH v2 1/1] vhost scsi: alloc vhost_scsi with kvzalloc() to avoid delay

2021-01-23 Thread Dongli Zhang
icitly set if the size to allocate is more than PAGE_SZIE and when __GFP_RETRY_MAYFAIL is not explicitly set. Cc: Aruna Ramakrishna Cc: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v1: - To combine kzalloc() and vzalloc() as kvzalloc() (suggested by Jason Wang) drivers/vhost/

Re: [PATCH 1/1] vhost scsi: allocate vhost_scsi with GFP_NOWAIT to avoid delay

2021-01-23 Thread Dongli Zhang
On 1/21/21 1:00 AM, Jason Wang wrote: > > On 2021/1/21 13:03, Dongli Zhang wrote: >> The size of 'struct vhost_scsi' is order-10 (~2.3MB). It may take long time >> delay by kzalloc() to compact memory pages when there is a lack of >> high-order pages. As a result, th

[PATCH 1/1] vhost scsi: allocate vhost_scsi with GFP_NOWAIT to avoid delay

2021-01-20 Thread Dongli Zhang
("vhost/scsi: use vmalloc for order-10 allocation") prefers to fallback only when really needed, while this patch changes allocation to GFP_NOWAIT in order to avoid the delay caused by memory page compact. Cc: Aruna Ramakrishna Cc: Joe Jin Signed-off-by: Dongli Zhang --- Another option is

Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error

2020-02-14 Thread dongli . zhang
] kthread+0xf3/0x130 [ 54.769302] ? process_one_work+0x360/0x360 [ 54.769303] ? kthread_bind+0x10/0x10 [ 54.769305] ret_from_fork+0x35/0x40 [ 54.769307] ---[ end trace 923a87a9ce0e777a ]--- Thank you very much! Dongli Zhang On 2/13/20 4:37 AM, Halil Pasic wrote: > Since nobody e

[PATCH 1/1] scsi: virtio_scsi: remove unused 'affinity_hint_set'

2019-06-19 Thread Dongli Zhang
The 'affinity_hint_set' is not used any longer since commit 0d9f0a52c8b9 ("virtio_scsi: use virtio IRQ affinity"). Signed-off-by: Dongli Zhang --- drivers/scsi/virtio_scsi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_sc

Re: [PATCH 1/1] virtio_blk: replace 0 by HCTX_TYPE_DEFAULT to index blk_mq_tag_set->map

2019-04-08 Thread Dongli Zhang
ping? The similar patchset has been queued by linux-scsi 5.2/scsi-queue. virtio-blk is the last place where HCTX_TYPE_DEFAULT is hardcoded. It would be more friendly to cscope if the hardcoding is avoided. Thank you very much! Dongli Zhang On 03/12/2019 09:31 AM, Dongli Zhang wrote: >

Re: [PATCH 0/2] Limit number of hw queues by nr_cpu_ids for virtio-blk and virtio-scsi

2019-04-08 Thread Dongli Zhang
ping? Thank you very much! Dongli Zhang On 03/27/2019 06:36 PM, Dongli Zhang wrote: > When tag_set->nr_maps is 1, the block layer limits the number of hw queues > by nr_cpu_ids. No matter how many hw queues are use by > virtio-blk/virtio-scsi, as they both have (tag_set-&

[PATCH 2/2] scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids

2019-03-27 Thread Dongli Zhang
queues used by virtio-scsi by nr_cpu_ids. Signed-off-by: Dongli Zhang --- drivers/scsi/virtio_scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 8af0177..9c4a3e1 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/driver

[PATCH 1/2] virtio-blk: limit number of hw queues by nr_cpu_ids

2019-03-27 Thread Dongli Zhang
queues used by virtio-blk by nr_cpu_ids. Signed-off-by: Dongli Zhang --- drivers/block/virtio_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 4bc083b..b83cb45 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio

[PATCH 0/2] Limit number of hw queues by nr_cpu_ids for virtio-blk and virtio-scsi

2019-03-27 Thread Dongli Zhang
vda/mq/ 0 1 2 3 Reference: https://lore.kernel.org/lkml/e4afe4c5-0262-4500-aeec-60f30734b4fc@default/ Thank you very much! Dongli Zhang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mail

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-20 Thread Dongli Zhang
On 3/20/19 8:53 PM, Jason Wang wrote: > > On 2019/3/19 上午10:22, Dongli Zhang wrote: >> Hi Jason, >> >> On 3/18/19 3:47 PM, Jason Wang wrote: >>> On 2019/3/15 下午8:41, Cornelia Huck wrote: >>>> On Fri, 15 Mar 2019 12:50:11 +0800 >>>> J

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-18 Thread Dongli Zhang
We should allow more vectors even the block layer would support at most nr_cpu_ids queues. I understand a new policy for queue-vector mapping is very helpful. I am just asking the question from block layer's point of view. Thank you very much! Dongli Zhang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-14 Thread Dongli Zhang
On 03/14/2019 08:13 PM, Cornelia Huck wrote: > On Thu, 14 Mar 2019 14:12:32 +0800 > Dongli Zhang wrote: > >> On 3/13/19 5:39 PM, Cornelia Huck wrote: >>> On Wed, 13 Mar 2019 11:26:04 +0800 >>> Dongli Zhang wrote: >>> >>>> On 3/13/1

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-14 Thread Dongli Zhang
On 03/14/2019 08:32 PM, Michael S. Tsirkin wrote: > On Tue, Mar 12, 2019 at 10:22:46AM -0700, Dongli Zhang wrote: >> I observed that there is one msix vector for config and one shared vector >> for all queues in below qemu cmdline, when the num-queues for virtio-blk >> is

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-14 Thread Dongli Zhang
On 3/13/19 5:39 PM, Cornelia Huck wrote: > On Wed, 13 Mar 2019 11:26:04 +0800 > Dongli Zhang wrote: > >> On 3/13/19 1:33 AM, Cornelia Huck wrote: >>> On Tue, 12 Mar 2019 10:22:46 -0700 (PDT) >>> Dongli Zhang wrote: >>> >>>> I obs

Re: virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-12 Thread Dongli Zhang
On 3/13/19 1:33 AM, Cornelia Huck wrote: > On Tue, 12 Mar 2019 10:22:46 -0700 (PDT) > Dongli Zhang wrote: > >> I observed that there is one msix vector for config and one shared vector >> for all queues in below qemu cmdline, when the num-queues for virtio-blk >&

virtio-blk: should num_vqs be limited by num_possible_cpus()?

2019-03-12 Thread Dongli Zhang
; -- PS: The same issue is applicable to virtio-scsi as well. Thank you very much! Dongli Zhang ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH 1/1] virtio_blk: replace 0 by HCTX_TYPE_DEFAULT to index blk_mq_tag_set->map

2019-03-11 Thread Dongli Zhang
Use HCTX_TYPE_DEFAULT instead of 0 to avoid hardcoding. Signed-off-by: Dongli Zhang --- This is the only place to cleanup under drivers/block/*. Another patch set is sent to scsi and then all of below are cleaned up: - block/* - drivers/* drivers/block/virtio_blk.c | 3 ++- 1 file changed, 2

[PATCH v2 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()

2018-12-09 Thread Dongli Zhang
VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead. Signed-off-by: Dongli Zhang --- Changed since v1: * leave the definition of VIRTIO_PCI_CONFIG() in header file to make userspace build happy drivers/virtio/virtio_pci_legacy.c | 6 -- 1 file changed, 4 insertions

Re: [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()

2018-12-07 Thread Dongli Zhang
On 12/08/2018 02:01 AM, Michael S. Tsirkin wrote: > On Fri, Dec 07, 2018 at 03:34:41PM +0800, Dongli Zhang wrote: >> VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead. >> >> Signed-off-by: Dongli Zhang >> --- >> drivers/virtio/virtio_pc

[PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()

2018-12-06 Thread Dongli Zhang
VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead. Signed-off-by: Dongli Zhang --- drivers/virtio/virtio_pci_legacy.c | 6 -- include/uapi/linux/virtio_pci.h| 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/virtio/virtio_pci_legacy.c b

Re: [PATCH v9] virtio_blk: add discard and write zeroes support

2018-11-02 Thread Dongli Zhang
Hi Daniel, Other than crosvm, is there any version of qemu (e.g., repositories developed in progress on github) where I can try with this feature? Thank you very much! Dongli Zhang On 11/02/2018 06:40 AM, Daniel Verkamp wrote: > From: Changpeng Liu > > In commit 88c85538, "v