[PATCH v2 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-22 Thread Dongli Zhang
as well, following a warning message, although theoretically it should never see apicd->move_in_progress with apicd->prev_cpu pointing to an offline CPU. Fixes: f0383c24b485 ("genirq/cpuhotplug: Add support for cleaning up move in progress") Cc: Joe Jin Signed-off-by: Dongli Zhang

Re: [PATCH 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-22 Thread Dongli Zhang
On 5/21/24 5:00 AM, Thomas Gleixner wrote: > On Wed, May 15 2024 at 12:51, Dongli Zhang wrote: >> On 5/13/24 3:46 PM, Thomas Gleixner wrote: >>> So yes, moving the invocation of irq_force_complete_move() before the >>> irq_needs_fixup() call makes sense, but it

Re: [PATCH 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-15 Thread Dongli Zhang
On 5/13/24 3:46 PM, Thomas Gleixner wrote: > On Mon, May 13 2024 at 10:43, Dongli Zhang wrote: >> On 5/13/24 5:44 AM, Thomas Gleixner wrote: >>> On Fri, May 10 2024 at 12:06, Dongli Zhang wrote: >>> Any interrupt which is affine to an outgoing CPU is migrated and &

Re: [PATCH 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-13 Thread Dongli Zhang
Hi Thomas, On 5/13/24 5:44 AM, Thomas Gleixner wrote: > On Fri, May 10 2024 at 12:06, Dongli Zhang wrote: >> The absence of IRQD_MOVE_PCNTXT prevents immediate effectiveness of >> interrupt affinity reconfiguration via procfs. Instead, the change is >> deferred un

[PATCH RESEND 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-10 Thread Dongli Zhang
comments and implementation of apic_update_vector(): "If the target CPU is offline then the regular release mechanism via the cleanup vector is not possible and the vector can be immediately freed in the underlying matrix allocator.". Cc: Joe Jin Signed-off-by: Dongli Zhang --- Correct the e

[PATCH 1/1] x86/vector: Fix vector leak during CPU offline

2024-05-10 Thread Dongli Zhang
comments and implementation of apic_update_vector(): "If the target CPU is offline then the regular release mechanism via the cleanup vector is not possible and the vector can be immediately freed in the underlying matrix allocator.". Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/x86/kerne

[PATCH v2 1/1] genirq/cpuhotplug: retry with cpu_online_mask when irq_do_set_affinity return -ENOSPC

2024-04-23 Thread Dongli Zhang
here the affinity mask does not contain any online CPU, but there is no fallback operation for this. Instead of giving up, retry the migration attempt with the online CPU mask if the interrupt is not managed, as managed interrupts cannot be affected by this problem. Cc: Joe Jin Signed-off-by: Dongli

Re: [PATCH 1/1] genirq/cpuhotplug: retry with online CPUs on irq_do_set_affinity failure

2024-04-22 Thread Dongli Zhang
Hi Thomas, On 4/22/24 13:58, Thomas Gleixner wrote: > On Thu, Apr 18 2024 at 18:33, Dongli Zhang wrote: > >> When a CPU is offline, its IRQs may migrate to other CPUs. For managed >> IRQs, they are migrated, or shutdown (if all CPUs of the managed IRQ >> affinity are of

[PATCH 1/1] genirq/cpuhotplug: retry with online CPUs on irq_do_set_affinity failure

2024-04-18 Thread Dongli Zhang
pen for managed IRQs because the vectors are already reserved before CPU hotplug. For regular IRQs, do a re-try with all online CPUs if the prior irq_do_set_affinity() is failed with -ENOSPC. Cc: Joe Jin Signed-off-by: Dongli Zhang --- kernel/irq/cpuhotplug.c | 13 + 1 file changed,

[PATCH 0/1] genirq/cpuhotplug: fix CPU hotplug set affinity failure issue

2024-04-18 Thread Dongli Zhang
0 30 32-49,51-52,54-57,59-63,65 7 173 0 0 29 32-49,51-52,54-58,60-62,64 Dongli Zhang

[PATCH v2 1/1] kernel/cpu: to track which CPUHP callback is failed

2021-04-08 Thread Dongli Zhang
6)" Cc: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v1 RFC: - use pr_debug() but not pr_err_once() (suggested by Qais Yousef) - print log for cpuhp_down_callbacks() as well (suggested by Qais Yousef) kernel/cpu.c | 8 1 file changed, 8 insertions(+) diff --git a/

Re: [PATCH RFC 1/1] kernel/cpu: to track which CPUHP callback is failed

2021-04-07 Thread Dongli Zhang
On 4/6/21 9:10 AM, Qais Yousef wrote: > On 04/05/21 14:22, Dongli Zhang wrote: >> May I have if there is any feedback on this? To pr_err_once() here helps >> narrow >> down what is the root cause of cpu online failure. >> >> >> The issue fixed by d7eb7

Re: [PATCH RFC 1/1] kernel/cpu: to track which CPUHP callback is failed

2021-04-05 Thread Dongli Zhang
PUs are not able to online. We will have below and know the root cause is with kvmclock, if we add the pr_err_once(). [0.693112] CPUHP callback failure (-12) for cpu 64 at kvmclock:setup_percpu (66) Thank you very much! Dongli Zhang On 3/9/21 11:08 PM, Dongli Zhang wrote: > During bo

[PATCH 1/1] KVM: x86: remove unused declaration of kvm_write_tsc()

2021-03-26 Thread Dongli Zhang
The kvm_write_tsc() was not used since commit 0c899c25d754 ("KVM: x86: do not attempt TSC synchronization on guest writes"). Remove its unused declaration. Signed-off-by: Dongli Zhang --- arch/x86/kvm/x86.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kvm/x86.h b/arch/x

Re: [PATCH 1/1] KVM: x86: to track if L1 is running L2 VM

2021-03-12 Thread Dongli Zhang
Hi Paolo, On 3/6/21 5:56 AM, Paolo Bonzini wrote: > On 05/03/21 23:57, Dongli Zhang wrote: >> The new per-cpu stat 'nested_run' is introduced in order to track if L1 VM >> is running or used to run L2 VM. >> >> An example of the usage of 'nested_run' is to help the host

[PATCH RFC 1/1] kernel/cpu: to track which CPUHP callback is failed

2021-03-09 Thread Dongli Zhang
is failed and usually the only symptom is cpu online failure. The error log is printed for once to have confirm which callback is failed. Cc: Joe Jin Signed-off-by: Dongli Zhang --- I used 'RFC' because WARN_ON_ONCE() is always used for the result from cpuhp_invoke_callback(). I would prefer to get

[PATCH 1/1] KVM: x86: to track if L1 is running L2 VM

2021-03-05 Thread Dongli Zhang
virtualization, the administrator will be able to easily narrow down and confirm if the issue is due to nested virtualization via 'nested_run'. For example, whether the fix like commit 88dddc11a8d6 ("KVM: nVMX: do not use dangling shadow VMCS after guest reset") is required. Cc: Joe Jin Signed-off-

[PATCH v2 1/1] KVM: x86: remove misplaced comment on active_mmu_pages

2021-02-25 Thread Dongli Zhang
The 'mmu_page_hash' is used as hash table while 'active_mmu_pages' is a list. Remove the misplaced comment as it's mostly stating the obvious anyways. Signed-off-by: Dongli Zhang Reviewed-by: Sean Christopherson --- Changed since v1: - change 'incorrect' to 'misplaced' arch/x86/include/asm

Re: [PATCH 1/1] KVM: x86: remove incorrect comment on active_mmu_pages

2021-02-25 Thread Dongli Zhang
On 2/25/21 4:44 PM, Sean Christopherson wrote: > On Tue, Feb 23, 2021, Dongli Zhang wrote: >> The 'mmu_page_hash' is used as hash table while 'active_mmu_pages' is a >> list. This patch removes the incorrect comment on active_mmu_pages. > > Maybe change the las

[PATCH 1/1] KVM: x86: remove incorrect comment on active_mmu_pages

2021-02-23 Thread Dongli Zhang
The 'mmu_page_hash' is used as hash table while 'active_mmu_pages' is a list. This patch removes the incorrect comment on active_mmu_pages. Signed-off-by: Dongli Zhang --- arch/x86/include/asm/kvm_host.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b

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

[PATCH RFC v1 2/6] swiotlb: convert variables to arrays

2021-02-03 Thread Dongli Zhang
- no_iotlb_memory There is no functional change and this is to prepare to enable 64-bit swiotlb. Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/powerpc/platforms/pseries/svm.c | 6 +- drivers/xen/swiotlb-xen.c| 4 +- include/linux/swiotlb.h | 5 +- kernel/dma/swiotlb.c

[PATCH RFC v1 6/6] xen-swiotlb: enable 64-bit xen-swiotlb

2021-02-03 Thread Dongli Zhang
This patch is to enable the 64-bit xen-swiotlb buffer. For Xen PVM DMA address, the 64-bit device will be able to allocate from 64-bit swiotlb buffer. Cc: Joe Jin Signed-off-by: Dongli Zhang --- drivers/xen/swiotlb-xen.c | 117 -- 1 file changed, 74

[PATCH RFC v1 5/6] xen-swiotlb: convert variables to arrays

2021-02-03 Thread Dongli Zhang
to enable 64-bit xen-swiotlb. Cc: Joe Jin Signed-off-by: Dongli Zhang --- drivers/xen/swiotlb-xen.c | 75 +-- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 662638093542..e18cae693cdc 100644

[PATCH RFC v1 1/6] swiotlb: define new enumerated type

2021-02-03 Thread Dongli Zhang
This is just to define new enumerated type without functional change. The 'SWIOTLB_LO' is to index legacy 32-bit swiotlb buffer, while the 'SWIOTLB_HI' is to index the 64-bit buffer. This is to prepare to enable 64-bit swiotlb. Cc: Joe Jin Signed-off-by: Dongli Zhang --- include/linux

[PATCH RFC v1 4/6] swiotlb: enable 64-bit swiotlb

2021-02-03 Thread Dongli Zhang
el will be able to allocate >4GB swiotlb buffer. This patch is only for swiotlb, not including xen-swiotlb. Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/mips/cavium-octeon/dma-octeon.c | 3 +- arch/powerpc/kernel/dma-swiotlb.c| 2 +- arch/powerpc/platforms/pseries/svm.

[PATCH RFC v1 0/6] swiotlb: 64-bit DMA buffer

2021-02-03 Thread Dongli Zhang
vm# cat /sys/kernel/debug/swiotlb/io_tlb_nslabs 65536 vm# cat /sys/kernel/debug/swiotlb/io_tlb_used 0 vm# cat /sys/kernel/debug/swiotlb/io_tlb_nslabs-highmem 1048576 vm# cat /sys/kernel/debug/swiotlb/io_tlb_used-highmem 64647 Please let me know if there is any feedback for this idea and RFC. Don

[PATCH RFC v1 3/6] swiotlb: introduce swiotlb_get_type() to calculate swiotlb buffer type

2021-02-03 Thread Dongli Zhang
This patch introduces swiotlb_get_type() in order to calculate which swiotlb buffer the given DMA address is belong to. This is to prepare to enable 64-bit swiotlb. Cc: Joe Jin Signed-off-by: Dongli Zhang --- include/linux/swiotlb.h | 14 ++ kernel/dma/swiotlb.c| 2 ++ 2

Re: [PATCH v2] xen-blkback: fix compatibility bug with single page rings

2021-01-30 Thread Dongli Zhang
On 1/29/21 12:13 AM, Paul Durrant wrote: >> -Original Message- >> From: Jürgen Groß >> Sent: 29 January 2021 07:35 >> To: Dongli Zhang ; Paul Durrant ; xen- >> de...@lists.xenproject.org; linux-bl...@vger.kernel.org; >> linux-kernel@vger.ker

Re: [PATCH v2] xen-blkback: fix compatibility bug with single page rings

2021-01-28 Thread Dongli Zhang
ront") > Signed-off-by: Paul Durrant > --- > Cc: Konrad Rzeszutek Wilk > Cc: "Roger Pau Monné" > Cc: Jens Axboe > Cc: Dongli Zhang > > v2: > - Remove now-spurious error path special-case when nr_grefs == 1 > --- > drivers/block/xen-blkback/common.

Re: [PATCH] xen-blkback: fix compatibility bug with single page rings

2021-01-27 Thread Dongli Zhang
nd by the previous frontend will try to map the wrong > grant reference. > > This patch restores the original behaviour. > > Fixes: 4a8c31a1c6f5 ("xen/blkback: rework connect_ring() to avoid > inconsistent xenstore 'ring-page-order' set by malicious blkfront") &g

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

[PATCH v3 1/1] page_frag: Recover from memory pressure

2020-11-15 Thread Dongli Zhang
RINIVAS Cc: sta...@vger.kernel.org Fixes: 79930f5892e ("net: do not deplete pfmemalloc reserve") Signed-off-by: Dongli Zhang Acked-by: Vlastimil Babka --- Changed since v1: - change author from Matthew to Dongli - Add references to all prior discussions - Add more details to comm

Re: [PATCH v2 1/1] page_frag: Recover from memory pressure

2020-11-15 Thread Dongli Zhang
On 11/15/20 4:18 AM, Matthew Wilcox wrote: > On Sat, Nov 14, 2020 at 10:51:06PM -0800, Dongli Zhang wrote: >> +if (nc->pfmemalloc) { > > You missed the unlikely() change that Eric recommended. > Thank you very much. I missed that email. I will send v3. Dongli Zhang

[PATCH v2 1/1] page_frag: Recover from memory pressure

2020-11-14 Thread Dongli Zhang
RINIVAS Cc: sta...@vger.kernel.org Fixes: 79930f5892e ("net: do not deplete pfmemalloc reserve") Signed-off-by: Dongli Zhang Acked-by: Vlastimil Babka --- Changed since v1: - change author from Matthew to Dongli - Add references to all prior discussions - Add more details to commit m

Re: [PATCH 1/1] mm: avoid re-using pfmemalloc page in page_frag_alloc()

2020-11-04 Thread Dongli Zhang
clear the >> pfmemalloc bit on the frag, as in my second patch. The 'least change' >> way of doing that is to try to allocate a page, but the VM could export >> a symbol that says "we're not under memory pressure any more". >> >> Did you want to move checking that into the networking layer, or do you >> want to keep it in the pagefrag allocator? > > I think your proposal is fine, thanks ! Hi Matthew, are you going to send out the patch to avoid pfmemalloc recycle? Thank you very much! Dongli Zhang

Re: [PATCH 1/1] mm: avoid re-using pfmemalloc page in page_frag_alloc()

2020-11-03 Thread Dongli Zhang
On 11/3/20 1:15 PM, Matthew Wilcox wrote: > On Tue, Nov 03, 2020 at 12:57:33PM -0800, Dongli Zhang wrote: >> On 11/3/20 12:35 PM, Matthew Wilcox wrote: >>> On Tue, Nov 03, 2020 at 11:32:39AM -0800, Dongli Zhang wrote: >>>> However, once kernel is not under memor

Re: [PATCH 1/1] mm: avoid re-using pfmemalloc page in page_frag_alloc()

2020-11-03 Thread Dongli Zhang
Hi Matthew, On 11/3/20 12:35 PM, Matthew Wilcox wrote: > On Tue, Nov 03, 2020 at 11:32:39AM -0800, Dongli Zhang wrote: >> The ethernet driver may allocates skb (and skb->data) via napi_alloc_skb(). >> This ends up to page_frag_alloc() to allocate skb->data from &

[PATCH 1/1] mm: avoid re-using pfmemalloc page in page_frag_alloc()

2020-11-03 Thread Dongli Zhang
na Ramakrishna Cc: Bert Barbe Cc: Rama Nichanamatlu Cc: Venkat Venkatsubra Cc: Manjunath Patil Cc: Joe Jin Cc: SRINIVAS Signed-off-by: Dongli Zhang --- mm/page_alloc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 23f5066bd4a5..291df2

[PATCH 1/1] blk-mq: fix comment as bt_tags_for_each() is not only for started request

2020-10-20 Thread Dongli Zhang
_iter() --> only BT_TAG_ITER_STATIC_RQS is set -> bt_tags_for_each() -> bt_tags_iter() Signed-off-by: Dongli Zhang --- block/blk-mq-tag.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 9c92053e704d..43af5063fe2e

Re: [PATCH 1/1] nvme-fcloop: verify wwnn and wwpn format

2020-06-10 Thread Dongli Zhang
Hi Christoph, Would you mind apply this one with the Reviewed-by from James and Sagi? https://lore.kernel.org/linux-nvme/60df6752-3512-f7a9-b0df-1096b93b8...@broadcom.com/ https://lore.kernel.org/linux-nvme/c4ec2d9e-b08c-19b2-16a5-93520ca13...@grimberg.me/ Thank you very much! Dongli Zhang

[PATCH 0/2] nvme: simple cleanup

2020-06-08 Thread Dongli Zhang
Just cleanup without functional change. Thank you very much! Dongli Zhang

[PATCH 2/2] nvme-pci: remove empty line following nvme_should_reset()

2020-06-08 Thread Dongli Zhang
Just cleanup by removing the empty line. Signed-off-by: Dongli Zhang --- drivers/nvme/host/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d690d5593a80..4471e9910906 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host

[PATCH 1/2] nvmet-loop: remove unused 'target_ctrl' in nvme_loop_ctrl

2020-06-08 Thread Dongli Zhang
This field is never used since the introduction of nvme loopback by commit 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver"). Signed-off-by: Dongli Zhang --- drivers/nvme/target/loop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/target/loop.c b/drivers/n

Re: [PATCH v2] docs: block: Create blk-mq documentation

2020-06-05 Thread Dongli Zhang
the block layer and later reused by the device driver, > removing > +the need to create a redundant identifier. When a request is completed in the > +drive, the tag is sent back to the block layer to notify it of the > finalization. > +This removes the need to do a linear search to find out which IO has been > +completed. Assume I am a beginner and does not know about blk-mq well. What I expect is to expand this sections to explain the usage of sbitmap to manage tags, e.g., like the comments in block/blk-mq-tag.c or block/blk-mq-tag.h. In addition, I would be interested in that percpu-refcount is used to track the lifecycle of requests. I have no idea how much detail is required for a kernel doc. The is just the feedback from me by assuming the audience is beginner :) Thank you very much! Dongli Zhang

Re: [PATCH 1/1] nvme-fcloop: verify wwnn and wwpn format

2020-06-04 Thread Dongli Zhang
tead, the address and port should be 0x0003 and 0x0001. This patch would sync the requirements of input format for nvme-fc and nvme-fcloop, unless this would break existing test suite (e.g., blktest). Thank you very much! Dongli Zhang On 5/25/20 9:21 PM, Dongli Zhang wrote: > The

Re: [PATCH 1/1] blk-mq: get ctx in order to handle BLK_MQ_S_INACTIVE in blk_mq_get_tag()

2020-06-03 Thread Dongli Zhang
Hi John, On 6/3/20 4:59 AM, John Garry wrote: > On 02/06/2020 07:17, Dongli Zhang wrote: >> When scheduler is set, we hit below page fault when we offline cpu. >> >> [ 1061.007725] BUG: kernel NULL pointer dereference, address: >> 0040 >> [ 1061.00

[PATCH 1/1] blk-mq: get ctx in order to handle BLK_MQ_S_INACTIVE in blk_mq_get_tag()

2020-06-02 Thread Dongli Zhang
ctx for blk_mq_put_tag(). Fixes: bf0beec0607db3c6 ("blk-mq: drain I/O when all CPUs in a hctx are offline") Signed-off-by: Dongli Zhang --- This is based on for-next because currently the pull request for v5.8 is not picked by mainline. block/blk-mq.c | 1 + 1 file changed, 1 inser

[PATCH 2/2] nbd: remove unused 'NBD_MAGIC'

2020-05-31 Thread Dongli Zhang
Remove 'NBD_MAGIC' as it is not used since commit 5ea8d10802ec ("nbd: separate out the config information"). Signed-off-by: Dongli Zhang --- drivers/block/nbd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 74c1363702f5..83435ce14

[PATCH 0/2] nbd: two cleanup

2020-05-31 Thread Dongli Zhang
This is just cleanup without functional change. Thank you very much! Dongli Zhang

[PATCH 1/2] nbd: append module param and description following corresponding variables

2020-05-31 Thread Dongli Zhang
the code. Signed-off-by: Dongli Zhang --- drivers/block/nbd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 43cff01a5a67..74c1363702f5 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -146,7 +146,13

[PATCH for-next 1/1] null_blk: force complete for timeout request

2020-05-29 Thread Dongli Zhang
the IO. Signed-off-by: Dongli Zhang --- drivers/block/null_blk_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 6126f771ae99..87b31f9ca362 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_bl

[PATCH v2 1/1] nvme-pci: avoid race between nvme_reap_pending_cqes() and nvme_poll()

2020-05-27 Thread Dongli Zhang
me_reap_pending_cqes(). Fixes: fa46c6fb5d61 ("nvme/pci: move cqe check after device shutdown") Signed-off-by: Dongli Zhang Reviewed-by: Ming Lei Reviewed-by: Keith Busch --- Changed since v1: - Add "Fixes" tag drivers/nvme/host/pci.c | 11 +++ 1 file changed, 7 insertions(

[PATCH 1/1] nvme-pci: avoid race between nvme_reap_pending_cqes() and nvme_poll()

2020-05-26 Thread Dongli Zhang
ap_pending_cqes(). Signed-off-by: Dongli Zhang --- drivers/nvme/host/pci.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 3726dc780d15..cc46e250fcac 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/h

[PATCH 1/1] nvme-fcloop: verify wwnn and wwpn format

2020-05-25 Thread Dongli Zhang
uld always be 18. Otherwise, the user may use e.g. 0x2 to create fcloop local port, while 0x0002 is required for nvme host and target. This makes the requirement of format confusing. Signed-off-by: Dongli Zhang --- drivers/nvme/target/fcloop.c | 29 +++-- 1 file c

[PATCH 1/1] xen/manage: enable C_A_D to force reboot

2020-05-13 Thread Dongli Zhang
oe Jin Cc: Boris Ostrovsky Signed-off-by: Dongli Zhang --- drivers/xen/manage.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index cd046684e0d1..3190d0ecb52e 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -204,6 +204,13 @@ s

[PATCH v2 1/1] xen-netfront: do not use ~0U as error return value for xennet_fill_frags()

2019-10-01 Thread Dongli Zhang
ad4f15dc2c70 ("xen/netfront: don't bug in case of too many frags") Signed-off-by: Dongli Zhang --- Changed since v1: - Always update queue->rx.rsp_cons inside xennet_fill_frags() so we do not need to add extra argument to xennet_fill_frags(). drivers/net/xen-netfront.c

[PATCH 1/1] xen-netfront: do not use ~0U as error return value for xennet_fill_frags()

2019-09-30 Thread Dongli Zhang
fixed in commit 00b368502d18 ("xen-netfront: do not assume sk_buff_head list is empty in error handling"). This patch uses an extra argument to help return if there is error in xennet_fill_frags(). Fixes: ad4f15dc2c70 ("xen/netfront: don't bug in case of too many frags") Signed-off

[PATCH 1/1] xen-netfront: do not assume sk_buff_head list is empty in error handling

2019-09-15 Thread Dongli Zhang
"xen/netfront: don't bug in case of too many frags") Signed-off-by: Dongli Zhang --- drivers/net/xen-netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 8d33970..5f5722b 100644 --- a/drivers/net/xe

[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: [5.2-rc1 regression]: nvme vs. hibernation

2019-05-24 Thread Dongli Zhang
Hi Jiri, Looks this has been discussed in the past. http://lists.infradead.org/pipermail/linux-nvme/2019-April/023234.html I created a fix for a case but not good enough. http://lists.infradead.org/pipermail/linux-nvme/2019-April/023277.html Perhaps people would have better solution. Dongli

Re: [PATCH 1/1] swiotlb: save io_tlb_used to local variable before leaving critical section

2019-04-15 Thread Dongli Zhang
On 04/15/2019 07:26 PM, Konrad Rzeszutek Wilk wrote: > > > On Mon, Apr 15, 2019, 2:50 AM Dongli Zhang <mailto:dongli.zh...@oracle.com>> wrote: > > As the patch to be fixed is still in Konrad's own tree, I will send the > v2 for > the patch to be fixed,

Re: [PATCH] block/mq: blk map queues by core id

2019-03-22 Thread Dongli Zhang
cpu1 cpu2 cpu3 cpu_list nr_reserved_tags nr_tags /sys/block/nvme0n1/mq/1: cpu4 cpu5 cpu6 cpu7 cpu_list nr_reserved_tags nr_tags Thank you very much! Dongli Zhang > for example (machine with 4 cores, 2 threads per core): > > normal physical server: > core-id thread

Re: [PATCH] block/mq: blk map queues by core id

2019-03-22 Thread Dongli Zhang
On 03/22/2019 06:09 PM, luferry wrote: > under virtual machine environment, cpu topology may differ from normal Would mind share the name of virtual machine monitor, the command line if available, and which device to reproduce. For instance, I am not able to reproduce with qemu nvme or

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-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: [Xen-devel] [PATCH v4.9 1/1] jiffies: use jiffies64_to_nsecs() to fix 100% steal usage for xen vcpu hotplug

2019-03-05 Thread Dongli Zhang
is reproduced on xen? This would help synchronize stable with mainline better. Thank you very much! Dongli Zhang On 3/5/19 3:59 PM, Dongli Zhang wrote: > [ Not relevant upstream, therefore no upstream commit. ] > > To fix, use jiffies64_to_nsecs() directly instead of deriving t

[PATCH v4.9 1/1] jiffies: use jiffies64_to_nsecs() to fix 100% steal usage for xen vcpu hotplug

2019-03-04 Thread Dongli Zhang
to the v4.9 series. Link: https://lkml.org/lkml/2019/2/28/1373 Suggested-by: Juergen Gross Signed-off-by: Dongli Zhang --- include/linux/jiffies.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 734377a..94aff43

Re: [BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage

2019-03-04 Thread Dongli Zhang
Hi Thomas, On 3/2/19 7:43 AM, Thomas Gleixner wrote: > On Thu, 28 Feb 2019, Dongli Zhang wrote: >> >> The root cause is that the return type of jiffies_to_usecs() is 'unsigned >> int', >> but not 'unsigned long'. As a result, the leading 32 bits are discarded. &g

Re: [BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage

2019-03-04 Thread Dongli Zhang
Hi Juergen, On 3/4/19 4:14 PM, Juergen Gross wrote: > On 01/03/2019 03:35, Dongli Zhang wrote: >> This issue is only for stable 4.9.x (e.g., 4.9.160), while the root cause is >> still in the lasted mainline kernel. >> >> This is obviated by new feature patch set ended w

[BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage

2019-02-28 Thread Dongli Zhang
anch as the patch set involves lots of changes. Would you please let me know if there is any suggestion on this issue? Thank you very much! Dongli Zhang

[PATCH for-next 1/1] blk-mq: use HCTX_TYPE_DEFAULT but not 0 to index blk_mq_tag_set->map

2019-02-27 Thread Dongli Zhang
Replace set->map[0] with set->map[HCTX_TYPE_DEFAULT] to avoid hardcoding. Signed-off-by: Dongli Zhang --- block/blk-mq.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 54535f4..4e502db 100644 --- a/block/blk-mq.c

Why the return type of jiffies_to_usecs() is 'unsigned int' but not 'unsigned long'

2019-02-26 Thread Dongli Zhang
ad for more details later to facilitate people to grep/search for similar/same issue on google in the future. That issue is not reproducible after I change the return type of jiffies_to_usecs() to 'unsigned long'. Thank you very much! Dongli Zhang

[PATCH v3 0/2] loop: fix two issues introduced by prior commit

2019-02-22 Thread Dongli Zhang
e. Changed since v1: * move the setting of lo->lo_state to Lo_unbound after partscan has finished as well (suggested by Jan Kara) Changed since v2: * Put the code inline in __loop_clr_fd() but not introduce new function (suggested by Jan Kara) Dongli Zhang

[PATCH v3 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part()

2019-02-22 Thread Dongli Zhang
x deadlock when calling blkdev_reread_part()") Signed-off-by: Dongli Zhang Reviewed-by: Jan Kara --- Changed since v1: * move the setting of lo->lo_state to Lo_unbound after partscan has finished as well (suggested by Jan Kara) Changed since v2: * Put the code inline in __loop_clr

[PATCH v3 1/2] loop: do not print warn message if partition scan is successful

2019-02-22 Thread Dongli Zhang
Do not print warn message when the partition scan returns 0. Fixes: d57f3374ba48 ("loop: Move special partition reread handling in loop_clr_fd()") Signed-off-by: Dongli Zhang Reviewed-by: Jan Kara --- drivers/block/loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

Re: [PATCH v2 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part()

2019-02-22 Thread Dongli Zhang
On 02/22/2019 07:47 PM, Jan Kara wrote: > On Thu 21-02-19 23:33:43, Dongli Zhang wrote: >> Commit 0da03cab87e6 >> ("loop: Fix deadlock when calling blkdev_reread_part()") moves >> blkdev_reread_part() out of the loop_ctl_mutex. However, >>

[PATCH v2 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part()

2019-02-21 Thread Dongli Zhang
x deadlock when calling blkdev_reread_part()") Signed-off-by: Dongli Zhang --- Changed since v1: * move the setting of lo->lo_state to Lo_unbound after partscan has finished as well (suggested by Jan Kara) drivers/block/loop.c | 26 ++ 1 file changed, 22 ins

[PATCH v2 0/2] loop: fix two issues introduced by prior commit

2019-02-21 Thread Dongli Zhang
e. Changed since v1: * move the setting of lo->lo_state to Lo_unbound after partscan has finished as well (suggested by Jan Kara) Dongli Zhang

[PATCH v2 1/2] loop: do not print warn message if partition scan is successful

2019-02-21 Thread Dongli Zhang
Do not print warn message when the partition scan returns 0. Fixes: d57f3374ba48 ("loop: Move special partition reread handling in loop_clr_fd()") Signed-off-by: Dongli Zhang Reviewed-by: Jan Kara --- drivers/block/loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

Re: [PATCH 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part()

2019-02-21 Thread Dongli Zhang
On 02/21/2019 07:30 PM, Jan Kara wrote: > On Thu 21-02-19 12:17:35, Dongli Zhang wrote: >> Commit 0da03cab87e6 >> ("loop: Fix deadlock when calling blkdev_reread_part()") moves >> blkdev_reread_part() out of the loop_ctl_mutex. However, >>

[PATCH 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part()

2019-02-20 Thread Dongli Zhang
x deadlock when calling blkdev_reread_part()") Signed-off-by: Dongli Zhang --- drivers/block/loop.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 7908673..736e55b 100644 --- a/drivers/block/loop.c +++ b/

[PATCH 0/2] loop: fix two issues introduced by prior commit

2019-02-20 Thread Dongli Zhang
ition scan is successful. [PATCH 2/2] loop: set GENHD_FL_NO_PART_SCAN after blkdev_reread_part() [PATCH 2/2] fixes 0da03cab87e6 ("loop: Fix deadlock when calling blkdev_reread_part()") to not set GENHD_FL_NO_PART_SCAN before partition scan when detaching loop device from the file. Thank yo

[PATCH 1/2] loop: do not print warn message if partition scan is successful

2019-02-20 Thread Dongli Zhang
Do not print warn message when the partition scan returns 0. Fixes: d57f3374ba48 ("loop: Move special partition reread handling in loop_clr_fd()") Signed-off-by: Dongli Zhang --- drivers/block/loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bl

Re: [Xen-devel] [PATCH v6 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-02-18 Thread Dongli Zhang
Hi Konrad, On 1/17/19 11:29 PM, Konrad Rzeszutek Wilk wrote: > On Tue, Jan 15, 2019 at 09:20:36AM +0100, Roger Pau Monné wrote: >> On Tue, Jan 15, 2019 at 12:41:44AM +0800, Dongli Zhang wrote: >>> The xenstore 'ring-page-order' is used globally for each blkback queue and &g

[PATCH v3 1/3] swiotlb: fix comment on swiotlb_bounce()

2019-01-17 Thread Dongli Zhang
Fix the comment as swiotlb_bounce() is used to copy from original dma location to swiotlb buffer during swiotlb_tbl_map_single(), while to copy from swiotlb buffer to original dma location during swiotlb_tbl_unmap_single(). Signed-off-by: Dongli Zhang --- kernel/dma/swiotlb.c | 2 +- 1 file

[PATCH v3 2/3] swiotlb: add debugfs to track swiotlb buffer usage

2019-01-17 Thread Dongli Zhang
of swiotlb buffer to pre-allocate or analyze device driver memory leak issue. Signed-off-by: Dongli Zhang --- Changed since v1: * init debugfs with late_initcall (suggested by Robin Murphy) * create debugfs entries with debugfs_create_ulong(suggested by Robin Murphy) Changed since v2: * some

[PATCH v3 3/3] swiotlb: checking whether swiotlb buffer is full with io_tlb_used

2019-01-17 Thread Dongli Zhang
This patch uses io_tlb_used to help check whether swiotlb buffer is full. io_tlb_used is no longer used for only debugfs. It is also used to help optimize swiotlb_tbl_map_single(). Suggested-by: Joe Jin Signed-off-by: Dongli Zhang --- Changed since v2: * move #ifdef folding to previous patch

Re: [Xen-devel] [PATCH 1/1] xen-blkback: do not wake up shutdown_wq after xen_blkif_schedule() is stopped

2019-01-17 Thread Dongli Zhang
Hi Roger, On 01/17/2019 04:20 PM, Roger Pau Monné wrote: > On Thu, Jan 17, 2019 at 10:10:00AM +0800, Dongli Zhang wrote: >> Hi Roger, >> >> On 2019/1/16 下午10:52, Roger Pau Monné wrote: >>> On Wed, Jan 16, 2019 at 09:47:41PM +0800, Dongli Zhang wrote: &g

Re: [Xen-devel] [PATCH 1/1] xen-blkback: do not wake up shutdown_wq after xen_blkif_schedule() is stopped

2019-01-16 Thread Dongli Zhang
Hi Roger, On 2019/1/16 下午10:52, Roger Pau Monné wrote: > On Wed, Jan 16, 2019 at 09:47:41PM +0800, Dongli Zhang wrote: >> There is no need to wake up xen_blkif_schedule() as kthread_stop() is able >> to already wake up the kernel thread. >> >> Signed-off-by: Dongli Zhan

Re: [Xen-devel] [PATCH v5 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-16 Thread Dongli Zhang
On 2019/1/17 上午12:32, Konrad Rzeszutek Wilk wrote: > On Tue, Jan 08, 2019 at 04:24:32PM +0800, Dongli Zhang wrote: >> oops. Please ignore this v5 patch. >> >> I just realized Linus suggested in an old email not use BUG()/BUG_ON() in >> the code. >> >&g

[PATCH 1/1] xen-blkback: do not wake up shutdown_wq after xen_blkif_schedule() is stopped

2019-01-16 Thread Dongli Zhang
There is no need to wake up xen_blkif_schedule() as kthread_stop() is able to already wake up the kernel thread. Signed-off-by: Dongli Zhang --- drivers/block/xen-blkback/xenbus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/xen-blkback/xenbus.c b

[PATCH v6 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-14 Thread Dongli Zhang
re 'ring-page-order' only once. Signed-off-by: Dongli Zhang --- Changed since v1: * change the order of xenstore read in read_per_ring_refs * use xenbus_read_unsigned() in connect_ring() Changed since v2: * simplify the condition check as "(err != 1 && nr_grefs > 1)"

[PATCH v6 1/2] xen/blkback: add stack variable 'blkif' in connect_ring()

2019-01-14 Thread Dongli Zhang
As 'be->blkif' is used for many times in connect_ring(), the stack variable 'blkif' is added to substitute 'be-blkif'. Suggested-by: Paul Durrant Signed-off-by: Dongli Zhang Reviewed-by: Paul Durrant Reviewed-by: Roger Pau Monné --- drivers/block/xen-blkback/xenbus.c |

Re: [Xen-devel] [PATCH v4 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-08 Thread Dongli Zhang
Hi Roger, On 01/07/2019 11:27 PM, Roger Pau Monné wrote: > On Mon, Jan 07, 2019 at 10:07:34PM +0800, Dongli Zhang wrote: >> >> >> On 01/07/2019 10:05 PM, Dongli Zhang wrote: >>> >>> >>> On 01/07/2019 08:01 PM, Roger Pau Monné wrote: >>>

Re: [Xen-devel] [PATCH v5 2/2] xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront

2019-01-08 Thread Dongli Zhang
oops. Please ignore this v5 patch. I just realized Linus suggested in an old email not use BUG()/BUG_ON() in the code. I will switch to the WARN() solution and resend again. Sorry for the junk email. Dongli Zhang On 2019/1/8 下午4:15, Dongli Zhang wrote: > The xenstore 'ring-page-or

[PATCH v5 1/2] xen/blkback: add stack variable 'blkif' in connect_ring()

2019-01-08 Thread Dongli Zhang
As 'be->blkif' is used for many times in connect_ring(), the stack variable 'blkif' is added to substitute 'be-blkif'. Suggested-by: Paul Durrant Signed-off-by: Dongli Zhang Reviewed-by: Paul Durrant Reviewed-by: Roger Pau Monné --- drivers/block/xen-blkback/xenbus.c |

  1   2   >