search for: atomic_dec

Displaying 20 results from an estimated 250 matches for "atomic_dec".

2013 Mar 15
1
Re: [PATCH 6/9] tools: memshr: arm64 support
...: "=r"(ia64_intri_res) : "r"(p), "i" (inc) \ > - : "memory"); \ > -} while (0) > -static inline void atomic_inc(uint32_t *v) { ia64_fetchadd4_rel(v, 1); } > -static inline void atomic_dec(uint32_t *v) { ia64_fetchadd4_rel(v, -1); } > -#elif defined(__arm__) > +#if defined(__arm__) > static inline void atomic_inc(uint32_t *v) > { > unsigned long tmp; > int result; > > - __asm__ __volatile__("@ atomic_add\n" > + __asm...
2020 Sep 24
1
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...node *inode, struct file *filep) > { > struct vhost_vdpa *v; > @@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) > return 0; > > err_init_iotlb: > - vhost_dev_cleanup(&v->vdev); > + vhost_vdpa_cleanup(v); > err: > atomic_dec(&v->opened); > return r; > @@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep) > vhost_vdpa_free_domain(v); > vhost_vdpa_config_put(v); > vhost_vdpa_clean_irq(v); > - vhost_dev_cleanup(&v->vdev); > - kfree(v->vdev....
2014 Sep 18
3
[PATCH] blk-mq: Avoid race condition with uninitialized requests
This patch should fix the bug reported in https://lkml.org/lkml/2014/9/11/249. Test is still pending. David Hildenbrand (1): blk-mq: Avoid race condition with uninitialized requests block/blk-mq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.8.5.5
2014 Sep 18
3
[PATCH] blk-mq: Avoid race condition with uninitialized requests
This patch should fix the bug reported in https://lkml.org/lkml/2014/9/11/249. Test is still pending. David Hildenbrand (1): blk-mq: Avoid race condition with uninitialized requests block/blk-mq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.8.5.5
2012 Aug 01
7
[PATCH] Btrfs: barrier before waitqueue_active
...ns(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 86eff48..43d1c5a 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -818,6 +818,7 @@ static void free_workspace(int type, struct list_head *workspace) btrfs_compress_op[idx]->free_workspace(workspace); atomic_dec(alloc_workspace); wake: + smp_mb(); if (waitqueue_active(workspace_wait)) wake_up(workspace_wait); } diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 335605c..8cc9b19 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -513,9 +513,11 @@ static void _...
2020 Sep 02
0
[PATCH v2 1/7] mm/thp: fix __split_huge_pmd_locked() for migration PMD
...ount reference anymore */ + if (!pmd_migration) { + /* + * Set PG_double_map before dropping compound_mapcount to avoid + * false-negative page_mapped(). + */ + if (compound_mapcount(page) > 1 && + !TestSetPageDoubleMap(page)) { for (i = 0; i < HPAGE_PMD_NR; i++) - atomic_dec(&page[i]._mapcount); + atomic_inc(&page[i]._mapcount); + } + + lock_page_memcg(page); + if (atomic_add_negative(-1, compound_mapcount_ptr(page))) { + /* Last compound_mapcount is gone. */ + __dec_lruvec_page_state(page, NR_ANON_THPS); + if (TestClearPageDoubleMap(page)) { + /...
2020 Sep 24
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...ev.vqs); +} + static int vhost_vdpa_open(struct inode *inode, struct file *filep) { struct vhost_vdpa *v; @@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) return 0; err_init_iotlb: - vhost_dev_cleanup(&v->vdev); + vhost_vdpa_cleanup(v); err: atomic_dec(&v->opened); return r; @@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep) vhost_vdpa_free_domain(v); vhost_vdpa_config_put(v); vhost_vdpa_clean_irq(v); - vhost_dev_cleanup(&v->vdev); - kfree(v->vdev.vqs); + vhost_vdpa_cleanup(v); mu...
2020 Sep 25
0
[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()
...gt;> struct vhost_vdpa *v; >> @@ -809,7 +815,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) >> return 0; >> >> err_init_iotlb: >> - vhost_dev_cleanup(&v->vdev); >> + vhost_vdpa_cleanup(v); >> err: >> atomic_dec(&v->opened); >> return r; >> @@ -840,8 +846,7 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep) >> vhost_vdpa_free_domain(v); >> vhost_vdpa_config_put(v); >> vhost_vdpa_clean_irq(v); >> - vhost_dev_cleanup(&v->vde...
2012 Aug 30
0
[PATCH 02/11] vmci_datagram.patch: VMCI datagram entity handling.
...ASSERT(data); + + dgInfo->entry->recvCB(dgInfo->entry->clientData, &dgInfo->msg); + + vmci_resource_release(&dgInfo->entry->resource); + + inDGHostQueue = dgInfo->inDGHostQueue; + kfree(dgInfo); + + if (inDGHostQueue) + atomic_dec(&delayedDGHostQueueSize); +} + +/* + * Dispatch datagram as a host, to the host, or other vm context. This + * function cannot dispatch to hypervisor context handlers. This should + * have been handled before we get here by VMCIDatagramDispatch. + * Returns number of bytes sent on success, erro...
2012 Aug 30
0
[PATCH 02/11] vmci_datagram.patch: VMCI datagram entity handling.
...ASSERT(data); + + dgInfo->entry->recvCB(dgInfo->entry->clientData, &dgInfo->msg); + + vmci_resource_release(&dgInfo->entry->resource); + + inDGHostQueue = dgInfo->inDGHostQueue; + kfree(dgInfo); + + if (inDGHostQueue) + atomic_dec(&delayedDGHostQueueSize); +} + +/* + * Dispatch datagram as a host, to the host, or other vm context. This + * function cannot dispatch to hypervisor context handlers. This should + * have been handled before we get here by VMCIDatagramDispatch. + * Returns number of bytes sent on success, erro...
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...f86atomic.h index 8c4b696..66a8d9a 100644 --- a/xf86atomic.h +++ b/xf86atomic.h @@ -49,7 +49,8 @@ typedef struct { # define atomic_read(x) ((x)->atomic) # define atomic_set(x, val) ((x)->atomic = (val)) # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) -# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) +# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0) # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)-&g...
2020 Sep 02
1
[PATCH v2 1/7] mm/thp: fix __split_huge_pmd_locked() for migration PMD
...ration) { > + /* > + * Set PG_double_map before dropping compound_mapcount to avoid > + * false-negative page_mapped(). > + */ > + if (compound_mapcount(page) > 1 && > + !TestSetPageDoubleMap(page)) { > for (i = 0; i < HPAGE_PMD_NR; i++) > - atomic_dec(&page[i]._mapcount); > + atomic_inc(&page[i]._mapcount); > + } > + > + lock_page_memcg(page); > + if (atomic_add_negative(-1, compound_mapcount_ptr(page))) { > + /* Last compound_mapcount is gone. */ > + __dec_lruvec_page_state(page, NR_ANON_THPS); > + if...
2015 Feb 26
4
[PATCH v2 1/4] Add atomic_inc_return to atomics.
...@@ -49,6 +49,7 @@ typedef struct { # define atomic_read(x) ((x)->atomic) # define atomic_set(x, val) ((x)->atomic = (val)) # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) # define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) @@ -68,6 +69,7 @@ typedef struct { # define atomic_read(x) AO_load...
2013 Mar 15
22
[PATCH 00/09] arm: tools: build for arm64 and enable cross-compiling for both arm32 and arm64
The following patches shave some rough edges off the tools build system to allow cross compiling for at least arm32 and arm64 based on the Debian/Ubuntu multiarch infrastructure. They also add the necessary fixes to build for arm64 (which I have only tried cross, not native). I have posted some instructions on how to compile with these patches on the wiki:
2012 Dec 12
7
[PATCH V5] x86/kexec: Change NMI and MCE handling on kexec path
...in getting very lucky with the "NMI or MCE in a 1 instruction race window on sysret" and managing to execute code in the hypervisor context. * Make use of set_ist() from the previous patch in the series to avoid open-coding the IST manipulation. Changes since v1: * Reintroduce atomic_dec(&waiting_for_crash_ipi); which got missed during the original refactoring. * Fold trap_nop into the middle of enable_nmis to reuse the iret. * Expand comments in areas as per Tim''s suggestions. diff -r ef8c1b607b10 -r 96b068439bc4 xen/arch/x86/crash.c --- a/xen/arch/x86/crash.c +...
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...100644 > --- a/xf86atomic.h > +++ b/xf86atomic.h > @@ -49,7 +49,8 @@ typedef struct { > # define atomic_read(x) ((x)->atomic) > # define atomic_set(x, val) ((x)->atomic = (val)) > # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) > -# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) > +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) > +# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0) The atomic_dec_and_test change seems like unrelated bugfi...
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
2020 Sep 03
1
[PATCH v3] mm/thp: fix __split_huge_pmd_locked() for migration PMD
...ount reference anymore */ + if (!pmd_migration) { + /* + * Set PG_double_map before dropping compound_mapcount to avoid + * false-negative page_mapped(). + */ + if (compound_mapcount(page) > 1 && + !TestSetPageDoubleMap(page)) { for (i = 0; i < HPAGE_PMD_NR; i++) - atomic_dec(&page[i]._mapcount); + atomic_inc(&page[i]._mapcount); + } + + lock_page_memcg(page); + if (atomic_add_negative(-1, compound_mapcount_ptr(page))) { + /* Last compound_mapcount is gone. */ + __dec_lruvec_page_state(page, NR_ANON_THPS); + if (TestClearPageDoubleMap(page)) { + /...
2015 Feb 25
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...omic.h >> +++ b/xf86atomic.h >> @@ -49,7 +49,8 @@ typedef struct { >> # define atomic_read(x) ((x)->atomic) >> # define atomic_set(x, val) ((x)->atomic = (val)) >> # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) >> -# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) >> +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) >> +# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0) > The atomic_dec_and_test change seems like un...
2012 Jun 27
4
[V4]fix ocfs2 aio/dio writing process hang
V4 changes: add Acked-by: Joel Becker <jlbec at evilplan.org> V3 changes: - add Cc: stable at vger.kernel.org in the patch header to align with stable rules - add Acked-by: Jeff Moyer <jmoyer at redhat.com> V2 changes: - update the patch header of the first patch to make it more clear. This patch list fixes an issue about ocfs2 aio/dio write process hang. The call trace is like