search for: test_and_set_bit

Displaying 20 results from an estimated 150 matches for "test_and_set_bit".

2016 Dec 07
5
[PATCH 1/2] vhost-vsock: remove unused vq variable
Signed-off-by: Peng Tao <bergwolf at gmail.com> --- drivers/vhost/vsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0c23b55..3e01d58 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -195,7 +195,6 @@ static int vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) { struct vhost_vsock *vsock; - struct
2016 Dec 07
5
[PATCH 1/2] vhost-vsock: remove unused vq variable
Signed-off-by: Peng Tao <bergwolf at gmail.com> --- drivers/vhost/vsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0c23b55..3e01d58 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -195,7 +195,6 @@ static int vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) { struct vhost_vsock *vsock; - struct
2001 Feb 01
1
one question
Hi Stephen, I'm one of developers of SnapFS, which based on Ext3. I got Assertion failure from SnapFS, at ext3_new_block() in fs/ext3/balloc.c: J_ASSERT (!test_and_set_bit(BH_Alloced, &bh->b_state)) If J_ASSERT is only use as debug, why it will modify data? I found the 'BH_Alloced' flag only occures at two place: one is balloc.c as above, the other is at journal_forget() in fs/jfs/transaction.c: J_ASSERT (!test_and_set_bit(BH_Freed, &bh->b_st...
2023 May 31
1
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...e have 2 global vars > > > > void *PTR = something_non_null; > > unsigned long FLAGS = -1ul; > > > > Now I think this code > > > > CPU_0 CPU_1 > > > > void *ptr = PTR; if (!test_and_set_bit(0, FLAGS)) > > clear_bit(0, FLAGS); PTR = NULL; > > BUG_ON(!ptr); > > > > is racy and can hit the BUG_ON(!ptr). > > This seems different to the above case? not sure, > And you can hit BUG_ON with > the following execution sequ...
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
From: Willem de Bruijn <willemb at google.com> As of tx napi, device down (`ip link set dev $dev down`) hangs unless tx napi is enabled. Else napi_enable is not called, so napi_disable will spin on test_and_set_bit NAPI_STATE_SCHED. Only call napi_disable if tx napi is enabled. Fixes: 5a719c2552ca ("virtio-net: transmit napi") Reported-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Willem de Bruijn <willemb at google.com> --- drivers/net/virtio_net.c | 10 ++++++++-- 1 file ch...
2017 Apr 25
3
[PATCH net-next] virtio-net: on tx, only call napi_disable if tx napi is on
From: Willem de Bruijn <willemb at google.com> As of tx napi, device down (`ip link set dev $dev down`) hangs unless tx napi is enabled. Else napi_enable is not called, so napi_disable will spin on test_and_set_bit NAPI_STATE_SCHED. Only call napi_disable if tx napi is enabled. Fixes: 5a719c2552ca ("virtio-net: transmit napi") Reported-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Willem de Bruijn <willemb at google.com> --- drivers/net/virtio_net.c | 10 ++++++++-- 1 file ch...
2016 Dec 07
0
[PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue
test_and_set_bit() already implies a memory barrier. Signed-off-by: Peng Tao <bergwolf at gmail.com> --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c6f2d89..2663543 100644 --- a/drivers/vhost/vhost.c +++ b/dri...
2006 Apr 19
0
[patch] define and use cpu_test_and_clear() and some type checking fixes
...b3ca881c903b xen/include/xen/cpumask.h --- a/xen/include/xen/cpumask.h Wed Apr 19 10:26:37 2006 -0400 +++ b/xen/include/xen/cpumask.h Wed Apr 19 11:45:07 2006 -0400 @@ -111,6 +111,12 @@ static inline int __cpu_test_and_set(int static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) { return test_and_set_bit(cpu, addr->bits); +} + +#define cpu_test_and_clear(cpu, cpumask) __cpu_test_and_clear((cpu), &(cpumask)) +static inline int __cpu_test_and_clear(int cpu, cpumask_t *addr) +{ + return test_and_clear_bit(cpu, addr->bits); } #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(sr...
2005 Dec 01
0
Errors reported by Coverity in ext3.
...s" is not checked Also see events: 61 ext3_journal_get_write_access(handle,bh); 62 } 63 return bh; --- 5. Error reported in ext3/balloc.c --- CID: 3545 Checker: CHECKED_RETURN File: fs/ext3/balloc.c Function: ext3_free_blocks_sb Description: Return value of "test_and_set_bit" is not checked 439 BUFFER_TRACE(bitmap_bh, "set in b_committed_data"); 440 J_ASSERT_BH(bitmap_bh, 441 bh2jh(bitmap_bh)->b_committed_data != NULL); Event check_return: Called function "test_and_set_bit" whose return value shoul...
2023 Jun 01
1
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...> void *PTR = something_non_null; > > > unsigned long FLAGS = -1ul; > > > > > > Now I think this code > > > > > > CPU_0 CPU_1 > > > > > > void *ptr = PTR; if (!test_and_set_bit(0, FLAGS)) > > > clear_bit(0, FLAGS); PTR = NULL; > > > BUG_ON(!ptr); > > > > > > is racy and can hit the BUG_ON(!ptr). > > > > This seems different to the above case? > > not sure, > > > And you can h...
2023 May 31
1
[syzbot] [kvm?] [net?] [virt?] general protection fault in vhost_work_queue
...t_work_init(&flush.work, vhost_flush_work); @@ -247,7 +247,9 @@ EXPORT_SYMBOL_GPL(vhost_dev_flush); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) { - if (!dev->worker) + struct vhost_task *vtsk = READ_ONCE(dev->worker.vtsk); + + if (!vtsk) return; if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) { @@ -255,8 +257,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) * sure it was not in the list. * test_and_set_bit() implies a memory barrier. */ - llist_add(&work->node, &dev->worker->work_list); - w...
2006 Oct 04
0
[PATCH,RFC 6/17] 32-on-64 shared info handling
...case 3: /* Write CR3 */ @@ -1611,7 +1612,7 @@ static void nmi_dom0_report(unsigned int if ( ((d = dom0) == NULL) || ((v = d->vcpu[0]) == NULL) ) return; - set_bit(reason_idx, &d->shared_info->arch.nmi_reason); + set_bit(reason_idx, nmi_reason(d)); if ( test_and_set_bit(_VCPUF_nmi_pending, &v->vcpu_flags) ) raise_softirq(NMI_SOFTIRQ); /* not safe to wake up a vcpu here */ Index: 2006-10-04/xen/arch/x86/x86_64/asm-offsets.c =================================================================== --- 2006-10-04.orig/xen/arch/x86/x86_64/asm-offsets.c 2006-...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...init_completion(&flush.wait_event); vhost_work_init(&flush.work, vhost_flush_work); @@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(vhost_dev_flush); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) { - if (!dev->worker) + if (!dev->worker.vtsk) return; if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) { @@ -255,8 +255,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) * sure it was not in the list. * test_and_set_bit() implies a memory barrier. */ - llist_add(&work->node, &dev->worker->work_list); - v...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...init_completion(&flush.wait_event); vhost_work_init(&flush.work, vhost_flush_work); @@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(vhost_dev_flush); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) { - if (!dev->worker) + if (!dev->worker.vtsk) return; if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) { @@ -255,8 +255,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) * sure it was not in the list. * test_and_set_bit() implies a memory barrier. */ - llist_add(&work->node, &dev->worker->work_list); - v...
2020 Aug 29
1
[PATCH v6 36/76] x86/head/64: Load IDT earlier
On Mon, Aug 24, 2020 at 10:54:31AM +0200, Joerg Roedel wrote: > @@ -385,3 +386,25 @@ void __init alloc_intr_gate(unsigned int n, const void *addr) > if (!WARN_ON(test_and_set_bit(n, system_vectors))) > set_intr_gate(n, addr); > } > + > +void __init early_idt_setup_early_handler(unsigned long physaddr) I wonder if you could drop one of the "early"es: idt_setup_early_handler() for example looks ok to me. Or early_setup_idt_handler() if you wanna...
2012 Feb 15
7
[PATCH v3] arm: support fewer LR registers than virtual irqs
...+void gic_set_guest_irq(unsigned int virtual_irq, + unsigned int state, unsigned int priority) +{ + int i; + struct pending_irq *iter, *n; + + spin_lock(&gic.lock); + + if ( list_empty(&gic.lr_pending) ) + { + for (i = 0; i < nr_lrs; i++) { + if (!test_and_set_bit(i, &gic.lr_mask)) + { + gic_set_lr(i, virtual_irq, state, priority); + spin_unlock(&gic.lock); + return; + } + } + } + + n = irq_to_pending(current, virtual_irq); + list_for_each_entry ( iter, &gic.lr_pen...
2023 Jun 01
1
[syzbot] [kvm?] [net?] [virt?] general protection fault in vhost_work_queue
...); > >@@ -247,7 +247,9 @@ EXPORT_SYMBOL_GPL(vhost_dev_flush); > > void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) > { >- if (!dev->worker) >+ struct vhost_task *vtsk = READ_ONCE(dev->worker.vtsk); >+ >+ if (!vtsk) > return; > > if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) { >@@ -255,8 +257,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) > * sure it was not in the list. > * test_and_set_bit() implies a memory barrier. > */ >- llist_add(&work->node, &dev->worker-...
2012 Nov 19
4
btrfs crash - Null dereference - 3.7.0-rc5-00068-gc5e35d6
Hi, my system suddenly crashed and gave me this dump: http://imgur.com/oO6S0 I checked and there is not btrfs commit in linus'' tree since I compiled this kernel. Gustavo
2023 Jun 06
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
...gt; vhost_work_init(&flush.work, vhost_flush_work); > >@@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(vhost_dev_flush); > > void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) > { >- if (!dev->worker) >+ if (!dev->worker.vtsk) > return; > > if (!test_and_set_bit(VHOST_WORK_QUEUED, &work->flags)) { >@@ -255,8 +255,8 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) > * sure it was not in the list. > * test_and_set_bit() implies a memory barrier. > */ >- llist_add(&work->node, &dev->worker-...
2019 Jan 04
4
[PATCH v2 0/2] virtio-balloon: tweak config_changed
Since virtio-ccw doesn't work with accessing to the config space inside an interrupt context, this patch series avoids that issue by moving the config register accesses to the related workqueue contexts. v1->v2 ChangeLog: - add config_read_bitmap to indicate to the workqueue callbacks about the necessity of reading the related config fields. Wei Wang (2): virtio-balloon: tweak