Home
last modified time | relevance | path

Searched refs:cmpxchg (Results 1 – 182 of 182) sorted by relevance

/linux-4.4.14/net/ipv6/
Dprotocol.c34 return !cmpxchg((const struct inet6_protocol **)&inet6_protos[protocol], in inet6_add_protocol()
43 ret = (cmpxchg((const struct inet6_protocol **)&inet6_protos[protocol], in inet6_del_protocol()
58 return !cmpxchg((const struct net_offload **)&inet6_offloads[protocol], in inet6_add_offload()
67 ret = (cmpxchg((const struct net_offload **)&inet6_offloads[protocol], in inet6_del_offload()
Dip6_icmp.c15 return (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, NULL, fn) == NULL) ? in inet6_register_icmp_sender()
24 ret = (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, fn, NULL) == fn) ? in inet6_unregister_icmp_sender()
Droute.c1018 prev = cmpxchg(p, NULL, pcpu_rt); in rt6_make_pcpu_route()
/linux-4.4.14/net/ipv4/
Dprotocol.c43 return !cmpxchg((const struct net_protocol **)&inet_protos[protocol], in inet_add_protocol()
50 return !cmpxchg((const struct net_offload **)&inet_offloads[protocol], in inet_add_offload()
59 ret = (cmpxchg((const struct net_protocol **)&inet_protos[protocol], in inet_del_protocol()
72 ret = (cmpxchg((const struct net_offload **)&inet_offloads[protocol], in inet_del_offload()
Dgre_demux.c40 return (cmpxchg((const struct gre_protocol **)&gre_proto[version], NULL, proto) == NULL) ? in gre_add_protocol()
52 ret = (cmpxchg((const struct gre_protocol **)&gre_proto[version], proto, NULL) == proto) ? in gre_del_protocol()
Dip_tunnel.c530 return !cmpxchg((const struct ip_tunnel_encap_ops **) in ip_tunnel_encap_add_ops()
544 ret = (cmpxchg((const struct ip_tunnel_encap_ops **) in ip_tunnel_encap_del_ops()
Droute.c481 if (old != now && cmpxchg(p_tstamp, old, now) == old) in ip_idents_reserve()
1327 prev = cmpxchg(p, orig, rt); in rt_cache_route()
Dtcp_output.c804 } while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags); in tcp_release_cb()
/linux-4.4.14/arch/s390/include/asm/
Dcmpxchg.h14 #define cmpxchg(ptr, o, n) \ macro
21 #define cmpxchg64 cmpxchg
22 #define cmpxchg_local cmpxchg
23 #define cmpxchg64_local cmpxchg
Dpercpu.h37 prev__ = cmpxchg(ptr__, old__, new__); \
140 ret__ = cmpxchg(ptr__, oval, nval); \
/linux-4.4.14/include/linux/
Datomic.h359 #define cmpxchg_relaxed cmpxchg
360 #define cmpxchg_acquire cmpxchg
361 #define cmpxchg_release cmpxchg
367 __atomic_op_acquire(cmpxchg, __VA_ARGS__)
372 __atomic_op_release(cmpxchg, __VA_ARGS__)
375 #ifndef cmpxchg
376 #define cmpxchg(...) \ macro
377 __atomic_op_fence(cmpxchg, __VA_ARGS__)
Dbitops.h224 } while (cmpxchg(ptr, old, new) != old); \
Dkvm_host.h289 return cmpxchg(&vcpu->mode, IN_GUEST_MODE, EXITING_GUEST_MODE); in kvm_vcpu_exiting_guest_mode()
/linux-4.4.14/kernel/locking/
Dqspinlock_paravirt.h105 if (!cmpxchg(&he->lock, NULL, lock)) { in pv_hash()
194 cmpxchg(&pn->state, vcpu_halted, vcpu_running); in pv_wait_node()
230 if (cmpxchg(&pn->state, vcpu_halted, vcpu_hashed) != vcpu_halted) in pv_kick_node()
283 if (!cmpxchg(&l->locked, _Q_LOCKED_VAL, _Q_SLOW_VAL)) { in pv_wait_head()
325 locked = cmpxchg(&l->locked, _Q_LOCKED_VAL, 0); in __pv_queued_spin_unlock()
Dosq_lock.c140 cmpxchg(&prev->next, node, NULL) == node) in osq_lock()
/linux-4.4.14/kernel/
Dtask_work.c36 } while (cmpxchg(&task->task_works, head, work) != head); in task_work_add()
71 else if (cmpxchg(pprev, work, work->next) == work) in task_work_cancel()
101 } while (cmpxchg(&task->task_works, work, head) != work); in task_work_run()
Dirq_work.c40 oflags = cmpxchg(&work->flags, flags, nflags); in irq_work_claim()
161 (void)cmpxchg(&work->flags, flags, flags & ~IRQ_WORK_BUSY); in irq_work_run_list()
Dacct.c174 cmpxchg(&acct->ns->bacct, pin, NULL); in acct_pin_kill()
Dwatchdog.c901 } while (cmpxchg(&watchdog_enabled, old, new) != old); in proc_watchdog_common()
Dpid.c150 last_write = cmpxchg(&pid_ns->last_pid, prev, pid); in set_last_pid()
Dexit.c1014 if (cmpxchg(&p->exit_state, EXIT_ZOMBIE, state) != EXIT_ZOMBIE) in wait_task_zombie()
/linux-4.4.14/arch/tile/include/asm/
Dcmpxchg.h51 #define cmpxchg(ptr, o, n) \ macro
102 #define cmpxchg(ptr, o, n) \ macro
126 #define cmpxchg64 cmpxchg
Dbitops_64.h43 oldval = cmpxchg(addr, guess, guess ^ mask); in change_bit()
88 oldval = cmpxchg(addr, guess, guess ^ mask); in test_and_change_bit()
Datomic_64.h56 oldval = cmpxchg(&v->counter, guess, guess + a); in __atomic_add_unless()
109 oldval = cmpxchg(&v->counter, guess, guess + a); in atomic64_add_unless()
Datomic.h139 return cmpxchg(&v->counter, o, n); in atomic_cmpxchg()
/linux-4.4.14/arch/frv/include/asm/
Dcmpxchg.h84 #define cmpxchg(ptr, test, new) \ macro
124 #define cmpxchg(ptr, test, new) \ macro
155 return cmpxchg((unsigned long *)ptr, old, new); in __cmpxchg_local()
Datomic.h164 #define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new))
/linux-4.4.14/lib/
Dllist.c45 } while (cmpxchg(&head->first, first, new_first) != first); in llist_add_batch()
75 entry = cmpxchg(&head->first, old_entry, next); in llist_del_first()
Dgenalloc.c54 } while ((nval = cmpxchg(addr, val, val | mask_to_set)) != val); in set_bits_ll()
69 } while ((nval = cmpxchg(addr, val, val & ~mask_to_clear)) != val); in clear_bits_ll()
Dlru_cache.c71 val = cmpxchg(&lc->flags, 0, LC_LOCKED); in lc_try_lock()
82 val = cmpxchg(&lc->flags, old, new); in lc_try_lock()
/linux-4.4.14/include/asm-generic/
Datomic.h48 while ((old = cmpxchg(&v->counter, c, c c_op i)) != c) \
58 while ((old = cmpxchg(&v->counter, c, c c_op i)) != c) \
177 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
Dcputime_jiffies.h6 #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new)
Dcmpxchg.h105 #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) macro
/linux-4.4.14/drivers/gpu/drm/
Ddrm_lock.c193 prev = cmpxchg(lock, old, new); in drm_lock_take()
236 prev = cmpxchg(lock, old, new); in drm_lock_transfer()
269 prev = cmpxchg(lock, old, new); in drm_legacy_lock_free()
323 prev = cmpxchg(lock, old, DRM_KERNEL_CONTEXT); in drm_legacy_idlelock_release()
/linux-4.4.14/arch/arc/include/asm/
Dcmpxchg.h69 #define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \ macro
81 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/arch/alpha/include/asm/
Dcmpxchg.h52 #define cmpxchg(ptr, o, n) \ macro
63 cmpxchg((ptr), (o), (n)); \
Drwsem.h61 res = cmpxchg(&sem->count, old, new); in __down_read_trylock()
95 long ret = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, in __down_write_trylock()
Datomic.h131 #define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) in ATOMIC_OPS()
134 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) in ATOMIC_OPS()
/linux-4.4.14/arch/xtensa/include/asm/
Drwsem.h43 if (tmp == cmpxchg(&sem->count, tmp, in __down_read_trylock()
71 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, in __down_write_trylock()
Dcmpxchg.h65 #define cmpxchg(ptr,o,n) \ macro
Datomic.h230 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) in ATOMIC_OPS()
/linux-4.4.14/arch/sparc/include/asm/
Drwsem.h37 if (tmp == cmpxchg(&sem->count, tmp, in __down_read_trylock()
67 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, in __down_write_trylock()
Datomic_64.h76 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) in ATOMIC_OPS()
95 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
Dcmpxchg_32.h57 #define cmpxchg(ptr, o, n) \ macro
Dcmpxchg_64.h107 #define cmpxchg(ptr,o,n) \ macro
/linux-4.4.14/arch/sh/include/asm/
Drwsem.h38 if (tmp == cmpxchg(&sem->count, tmp, in __down_read_trylock()
66 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, in __down_write_trylock()
Dcmpxchg.h60 #define cmpxchg(ptr,o,n) \ macro
Datomic.h39 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/arch/blackfin/include/asm/
Dcmpxchg.h68 #define cmpxchg(ptr, o, n) \ macro
125 #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) macro
/linux-4.4.14/arch/tile/gxio/
Ddma_queue.c81 cmpxchg(&dma_queue->hw_complete_count, in __gxio_dma_queue_update_credits()
107 if (cmpxchg(&dma_queue->hw_complete_count, in __gxio_dma_queue_update_credits()
/linux-4.4.14/arch/ia64/include/uapi/asm/
Dcmpxchg.h129 #define cmpxchg(ptr, o, n) cmpxchg_acq((ptr), (o), (n)) macro
132 #define cmpxchg_local cmpxchg
DKbuild10 header-y += cmpxchg.h
/linux-4.4.14/Documentation/virtual/kvm/
Dlocking.txt26 On fast page fault path, we will use cmpxchg to atomically set the spte W
28 is safe because whenever changing these bits can be detected by cmpxchg.
33 is not changed during cmpxchg. This is a ABA problem, for example, below case
55 if (cmpxchg(spte, old_spte, old_spte+W)
62 to gfn. For indirect sp, before we do cmpxchg, we call gfn_to_pfn_atomic()
/linux-4.4.14/arch/x86/include/asm/
Dcmpxchg_64.h12 cmpxchg((ptr), (o), (n)); \
Dspinlock.h84 cmpxchg(&lock->head_tail, old.head_tail, new.head_tail); in __ticket_check_and_clear_slowpath()
143 return cmpxchg(&lock->head_tail, old.head_tail, new.head_tail) == old.head_tail; in arch_spin_trylock()
Datomic.h177 return cmpxchg(&v->counter, old, new); in atomic_cmpxchg()
Datomic64_64.h166 return cmpxchg(&v->counter, old, new); in atomic64_cmpxchg()
Dcmpxchg.h146 #define cmpxchg(ptr, old, new) \ macro
/linux-4.4.14/arch/mips/include/asm/
Dcmpxchg.h227 #define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb()) macro
240 cmpxchg((ptr), (o), (n)); \
Datomic.h215 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
500 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/arch/powerpc/include/asm/
Dcmpxchg.h274 #define cmpxchg(ptr, o, n) \ macro
295 cmpxchg((ptr), (o), (n)); \
Datomic.h158 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
422 #define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
Dcputime.h35 #define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new)
/linux-4.4.14/arch/powerpc/kvm/
Dbook3s_hv_builtin.c250 } while (cmpxchg(&vc->entry_exit_map, ee, ee | me) != ee); in kvmhv_commence_exit()
280 } while (cmpxchg(&vc->entry_exit_map, ee, in kvmhv_commence_exit()
Dbooke.c611 } while (cmpxchg(&vcpu->arch.tsr, tsr, new_tsr) != tsr); in kvmppc_watchdog_func()
/linux-4.4.14/arch/openrisc/include/asm/
DKbuild13 generic-y += cmpxchg-local.h
14 generic-y += cmpxchg.h
/linux-4.4.14/arch/arm/include/asm/
Dsync_bitops.h23 #define sync_cmpxchg cmpxchg
/linux-4.4.14/arch/hexagon/include/asm/
Dcmpxchg.h68 #define cmpxchg(ptr, old, new) \ macro
/linux-4.4.14/arch/arm64/include/asm/
Dsync_bitops.h24 #define sync_cmpxchg cmpxchg
Dcmpxchg.h162 #define cmpxchg(...) __cmpxchg_wrapper( _mb, __VA_ARGS__) macro
169 #define cmpxchg64 cmpxchg
Datomic.h90 #define atomic_cmpxchg(v, old, new) cmpxchg(&((v)->counter), (old), (new))
/linux-4.4.14/arch/score/include/asm/
Dcmpxchg.h40 #define cmpxchg(ptr, o, n) \ macro
/linux-4.4.14/net/core/
Dlwtunnel.c49 return !cmpxchg((const struct lwtunnel_encap_ops **) in lwtunnel_encap_add_ops()
64 ret = (cmpxchg((const struct lwtunnel_encap_ops **) in lwtunnel_encap_del_ops()
Ddst.c327 prev = cmpxchg(&dst->_metrics, old, new); in dst_cow_metrics_generic()
346 prev = cmpxchg(&dst->_metrics, old, new); in __dst_destroy_metrics_generic()
/linux-4.4.14/arch/metag/include/asm/
Dcmpxchg.h54 #define cmpxchg(ptr, o, n) \ macro
/linux-4.4.14/arch/tile/kernel/
Dpmc.c41 return cmpxchg(&perf_irq, NULL, new_perf_irq); in reserve_pmc_hardware()
/linux-4.4.14/Documentation/features/locking/cmpxchg-local/
Darch-support.txt2 # Feature name: cmpxchg-local
/linux-4.4.14/arch/mn10300/include/asm/
Dcmpxchg.h110 #define cmpxchg(ptr, o, n) \ macro
Datomic.h132 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
/linux-4.4.14/fs/f2fs/
Dcrypto_key.c109 prev = cmpxchg(&fi->i_crypt_info, ci, NULL); in f2fs_free_encryption_info()
234 if (cmpxchg(&fi->i_crypt_info, NULL, crypt_info) != NULL) { in _f2fs_get_encryption_info()
/linux-4.4.14/arch/ia64/include/asm/
Datomic.h134 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
138 (cmpxchg(&((v)->counter), old, new))
Dpgtable.h445 } while (cmpxchg((unsigned long *) ptep, old, new) != old); in ptep_set_wrprotect()
/linux-4.4.14/arch/parisc/include/asm/
Datomic.h74 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
231 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
Dcmpxchg.h73 #define cmpxchg(ptr, o, n) \ macro
/linux-4.4.14/arch/x86/kernel/cpu/
Dperf_event_amd.c250 if (cmpxchg(nb->owners + i, event, NULL) == event) in __amd_put_nb_event_constraints()
319 old = cmpxchg(nb->owners + idx, NULL, event); in __amd_get_nb_event_constraints()
331 cmpxchg(nb->owners + new, event, NULL); in __amd_get_nb_event_constraints()
Dperf_event_amd_uncore.c138 if (cmpxchg(&uncore->events[i], NULL, event) == NULL) { in amd_uncore_add()
168 if (cmpxchg(&uncore->events[i], event, NULL) == event) in amd_uncore_del()
/linux-4.4.14/arch/avr32/include/asm/
Dcmpxchg.h87 #define cmpxchg(ptr, old, new) \ macro
Datomic.h182 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/arch/tile/lib/
Dspinlock_64.c60 return cmpxchg(&lock->lock, val, (val + 1) & ~__ARCH_SPIN_NEXT_OVERFLOW) in arch_spin_trylock()
/linux-4.4.14/fs/ext4/
Dcrypto_key.c107 prev = cmpxchg(&ei->i_crypt_info, ci, NULL); in ext4_free_encryption_info()
257 if (cmpxchg(&ei->i_crypt_info, NULL, crypt_info) != NULL) { in _ext4_get_encryption_info()
Dinode.c685 cmpxchg(&bh->b_state, old_state, new_state) != old_state)); in ext4_update_bh_state()
4103 } while (cmpxchg(&ei->i_flags, old_fl, new_fl) != old_fl); in ext4_get_inode_flags()
/linux-4.4.14/mm/
Dmmzone.c110 } while (unlikely(cmpxchg(&page->flags, old_flags, flags) != old_flags)); in page_cpupid_xchg_last()
Dcleancache.c54 if (cmpxchg(&cleancache_ops, NULL, ops)) in cleancache_register_ops()
Dfrontswap.c140 } while (cmpxchg(&frontswap_ops, ops->next, ops) != ops->next); in frontswap_register_ops()
Dkmemleak.c1812 if (cmpxchg(&kmemleak_error, 0, 1)) in kmemleak_disable()
Dmemcontrol.c919 (void)cmpxchg(&iter->position, pos, NULL); in mem_cgroup_iter()
971 (void)cmpxchg(&iter->position, pos, memcg); in mem_cgroup_iter()
1019 cmpxchg(&iter->position, in invalidate_reclaim_iterators()
Dhuge_memory.c191 if (cmpxchg(&huge_zero_page, NULL, zero_page)) { in get_huge_zero_page()
Dpage_alloc.c6509 old_word = cmpxchg(&bitmap[word_bitidx], word, (word & ~mask) | flags); in set_pfnblock_flags_mask()
/linux-4.4.14/Documentation/trace/
Dring-buffer-design.txt38 cmpxchg - hardware-assisted atomic transaction that performs the following:
42 R = cmpxchg(A, C, B) is saying that we replace A with B if and only if
432 When the tail page meets the head pointer, it will use cmpxchg to
460 will also use cmpxchg. If the flag bit in the pointer to the
496 It does a cmpxchg with the pointer to the previous head page to make it
569 performs a cmpxchg to convert the pointer to the head page from the HEADER
676 is not the next page, the tail page is simply updated with a cmpxchg.
683 cmpxchg(tail_page, temp_page, next_page)
712 The above would fail the cmpxchg, but since the tail page has already
910 Since the cmpxchg returns the old value of the pointer the first writer
/linux-4.4.14/arch/m68k/include/asm/
Dcmpxchg.h120 #define cmpxchg(ptr, o, n) \ macro
Datomic.h124 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/drivers/gpu/drm/i810/
Di810_dma.c60 used = cmpxchg(buf_priv->in_use, I810_BUF_FREE, in i810_freelist_get()
78 used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE); in i810_freelist_put()
772 (void)cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, in i810_dma_dispatch_vertex()
871 int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE, in i810_flush_queue()
904 int used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, in i810_driver_reclaim_buffers()
1042 u = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_HARDWARE); in i810_dma_dispatch_mc()
/linux-4.4.14/arch/cris/include/asm/
DKbuild6 generic-y += cmpxchg.h
/linux-4.4.14/arch/m32r/include/asm/
Dcmpxchg.h190 #define cmpxchg(ptr, o, n) \ macro
Datomic.h219 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
/linux-4.4.14/net/netfilter/
Dnf_conntrack_labels.c60 } while (cmpxchg(address, old, tmp) != old); in replace_u32()
Dxt_connlimit.c375 cmpxchg(&connlimit_rnd, 0, rand); in connlimit_mt_check()
Dnf_conntrack_core.c811 cmpxchg(&nf_conntrack_hash_rnd, 0, rand); in init_nf_conntrack_hash_rnd()
/linux-4.4.14/arch/s390/kvm/
Dgaccess.c286 } while (cmpxchg(&ic->val, old.val, new.val) != old.val); in ipte_lock_simple()
304 } while (cmpxchg(&ic->val, old.val, new.val) != old.val); in ipte_unlock_simple()
324 } while (cmpxchg(&ic->val, old.val, new.val) != old.val); in ipte_lock_siif()
338 } while (cmpxchg(&ic->val, old.val, new.val) != old.val); in ipte_unlock_siif()
Dinterrupt.c1013 if (cmpxchg(sigp_ctrl, old_val, new_val) != old_val) { in __inject_extcall_sigpif()
/linux-4.4.14/arch/arc/kernel/
Dsmp.c234 } while (cmpxchg(ipi_data_ptr, old, new) != old); in ipi_send_msg_one()
/linux-4.4.14/drivers/staging/speakup/
Dselection.c178 if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL) in speakup_paste_selection()
/linux-4.4.14/arch/x86/xen/
Dspinlock.c96 ret = cmpxchg(&zero_stats, old, 0); in check_zero()
Dp2m.c578 old_mfn = cmpxchg(top_mfn_p, missing_mfn, mid_mfn_mfn); in xen_alloc_p2m_entry()
/linux-4.4.14/arch/ia64/kernel/
Dtime.c344 ret = cmpxchg(&itc_jitter_data.itc_lastcycle, lcycle, now); in itc_get_cycles()
Dsetup.c1028 if (cmpxchg(&ia64_ctx.max_ctx, old, max_ctx) == old) in cpu_init()
/linux-4.4.14/drivers/phy/
Dphy-rcar-gen2.c84 if (cmpxchg(&channel->selected_phy, -1, phy->number) != -1) in rcar_gen2_phy_init()
/linux-4.4.14/drivers/xen/
Dmcelog.c170 } while (cmpxchg(&xen_mcelog.flags, flags, 0) != flags); in xen_mce_chrdev_ioctl()
/linux-4.4.14/Documentation/locking/
Drt-mutex.txt42 without waiters. The optimized fastpath operations require cmpxchg
Drt-mutex-design.txt325 cmpxchg Tricks
328 Some architectures implement an atomic cmpxchg (Compare and Exchange). This
332 cmpxchg is basically the following function performed atomically:
342 #define cmpxchg(a,b,c) _cmpxchg(&a,&b,&c)
/linux-4.4.14/drivers/net/ethernet/sfc/
Dnet_driver.h504 prev = cmpxchg(&channel->busy_poll_state, old, in efx_channel_lock_napi()
527 return cmpxchg(&channel->busy_poll_state, EFX_CHANNEL_STATE_IDLE, in efx_channel_try_lock_poll()
Dmcdi.c409 return cmpxchg(&mcdi->state, in efx_mcdi_acquire_async()
420 cmpxchg(&mcdi->state, in efx_mcdi_acquire_sync()
452 if (cmpxchg(&mcdi->state, in efx_mcdi_complete_sync()
504 if (cmpxchg(&mcdi->state, in efx_mcdi_complete_async()
Dptp.c1718 (void) cmpxchg(&channel->sync_events_state, SYNC_EVENTS_REQUESTED, in efx_time_sync_event()
/linux-4.4.14/kernel/rcu/
Dtree_plugin.h2658 newoldstate = cmpxchg(&full_sysidle_state, in rcu_sysidle_force_exit()
2813 (void)cmpxchg(&full_sysidle_state, in rcu_sysidle()
2824 (void)cmpxchg(&full_sysidle_state, in rcu_sysidle()
2938 rss = cmpxchg(&full_sysidle_state, in rcu_sys_is_idle()
/linux-4.4.14/drivers/misc/sgi-xp/
Dxpc_sn2.c1726 cmpxchg(&notify->type, notify_type, 0) != notify_type) { in xpc_notify_senders_sn2()
1998 if (cmpxchg(&ch_sn2->w_local_GP.get, get, get + 1) == get) { in xpc_get_deliverable_payload_sn2()
2117 if (cmpxchg(&ch_sn2->w_local_GP.put, put, put + 1) == in xpc_allocate_msg_sn2()
2224 if (cmpxchg(&notify->type, notify_type, 0) == in xpc_send_payload_sn2()
Dxpc_uv.c1371 if (func != NULL && cmpxchg(&msg_slot->func, func, NULL) == func) { in xpc_notify_sender_uv()
1599 if (cmpxchg(&msg_slot->func, func, NULL) != func) { in xpc_send_payload_uv()
Dxpc_main.c1102 if (cmpxchg(&xpc_die_disconnecting, 0, 1)) in xpc_die_deactivate()
/linux-4.4.14/kernel/trace/
Dtrace_functions.c395 new_count = cmpxchg(count, old_count, new_count); in ftrace_stacktrace_count()
Dring_buffer.c904 ret = cmpxchg((unsigned long *)&list->next, in rb_head_page_set()
997 ret = cmpxchg(ptr, val, (unsigned long)&new->list); in rb_head_page_replace()
1064 old_tail = cmpxchg(&cpu_buffer->tail_page, in rb_tail_page_update()
1584 r = cmpxchg(&prev_page->next, head_page_with_bit, first_page); in rb_insert_pages()
Dblktrace.c522 if (cmpxchg(&q->blk_trace, NULL, bt)) in do_blk_trace_setup()
1499 if (cmpxchg(&q->blk_trace, NULL, bt)) in blk_trace_setup_queue()
/linux-4.4.14/arch/x86/kernel/acpi/
Dboot.c1686 val = cmpxchg(lock, old, new); in __acpi_acquire_global_lock()
1697 val = cmpxchg(lock, old, new); in __acpi_release_global_lock()
/linux-4.4.14/drivers/misc/genwqe/
Dcard_ddcb.c310 icrc_hsi_shi = cmpxchg(&prev_ddcb->icrc_hsi_shi_32, old, new); in enqueue_ddcb()
657 icrc_hsi_shi = cmpxchg(&pddcb->icrc_hsi_shi_32, in __genwqe_purge_ddcb()
/linux-4.4.14/arch/x86/kvm/
Dpaging_tmpl.h48 #define CMPXCHG cmpxchg
67 #define CMPXCHG cmpxchg
Dvmx.c2032 } while (cmpxchg(&pi_desc->control, old.control, in vmx_vcpu_pi_load()
10653 } while (cmpxchg(&pi_desc->control, old.control, in vmx_pre_block()
10685 } while (cmpxchg(&pi_desc->control, old.control, in vmx_post_block()
Dx86.c4507 (cmpxchg((t *)(ptr), *(t *)(old), *(t *)(new)) == *(t *)(old))
/linux-4.4.14/arch/x86/kernel/cpu/mcheck/
Dmce.c190 if (cmpxchg(&mcelog.next, entry, next) == entry) in mce_log()
1868 next = cmpxchg(&mcelog.next, prev, 0); in mce_chrdev_read()
1928 } while (cmpxchg(&mcelog.flags, flags, 0) != flags); in mce_chrdev_ioctl()
/linux-4.4.14/sound/soc/xtensa/
Dxtfpga-i2s.c172 cmpxchg(&i2s->tx_ptr, tx_ptr, new_tx_ptr); in xtfpga_pcm_push_tx()
/linux-4.4.14/Documentation/
Datomic_ops.txt541 The routines xchg() and cmpxchg() must provide the same exact
545 Note: If someone wants to use xchg(), cmpxchg() and their variants,
546 linux/atomic.h should be included rather than asm/cmpxchg.h, unless
Dthis_cpu_ops.txt24 RMW (Read Modify Write) instructions like inc/dec/cmpxchg without the
Dmemory-barriers.txt2345 cmpxchg();
/linux-4.4.14/arch/x86/kernel/
Dkvm.c647 ret = cmpxchg(&zero_stats, old, 0); in check_zero()
/linux-4.4.14/drivers/char/
Drandom.c673 if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) in credit_entropy_bits()
1071 if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) in account()
/linux-4.4.14/fs/nfs/flexfilelayout/
Dflexfilelayoutdev.c353 if (cmpxchg(&mirror->cred, NULL, cred)) in ff_layout_update_mirror_cred()
/linux-4.4.14/drivers/gpu/drm/vmwgfx/
Dvmwgfx_fifo.c171 if (cmpxchg(fifo_mem + SVGA_FIFO_BUSY, 0, 1) == 0) in vmw_fifo_ping_host()
/linux-4.4.14/drivers/block/
Dataflop.c655 wait_event(fdc_wait, cmpxchg(&fdc_busy, 0, 1) == 0); in do_format()
1501 wait_event(fdc_wait, cmpxchg(&fdc_busy, 0, 1) == 0); in do_fd_request()
/linux-4.4.14/drivers/md/
Ddm-bufio.c339 (void)cmpxchg(&dm_bufio_cache_size, 0, in __cache_size_refresh()
677 (void)cmpxchg(&c->async_write_error, 0, error); in write_endio()
Draid5-cache.c779 } while (cmpxchg(&log->reclaim_target, target, new) != target); in r5l_wake_reclaim()
Ddm.c292 (void)cmpxchg(module_param, param, modified_param); in __dm_get_module_param()
/linux-4.4.14/drivers/staging/rdma/ipath/
Dipath_ruc.c389 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in ipath_ruc_loopback()
Dipath_rc.c1911 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in ipath_rc_rcv()
/linux-4.4.14/arch/x86/mm/
Dpat.c132 } while (cmpxchg(&pg->flags, old_flags, new_flags) != old_flags); in set_page_memtype()
/linux-4.4.14/net/rds/
Dib_recv.c494 old = cmpxchg(&cache->xfer, NULL, chpfirst); in rds_ib_recv_cache_put()
/linux-4.4.14/drivers/infiniband/hw/qib/
Dqib_ruc.c503 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in qib_ruc_loopback()
Dqib_rc.c2208 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in qib_rc_rcv()
/linux-4.4.14/drivers/acpi/apei/
Dghes.c637 if (slot != -1 && cmpxchg(ghes_estatus_caches + slot, in ghes_estatus_cache_add()
/linux-4.4.14/fs/
Ddirect-io.c556 old = cmpxchg(&sb->s_dio_done_wq, NULL, wq); in sb_init_dio_done_wq()
Daio.c565 cancel = cmpxchg(&kiocb->ki_cancel, old, KIOCB_CANCELLED); in kiocb_cancel()
Dexec.c1707 } while (cmpxchg(&mm->flags, old, new) != old); in set_dumpable()
Dinode.c2027 } while (unlikely(cmpxchg(&inode->i_flags, old_flags, in inode_set_flags()
Dfs-writeback.c255 if (unlikely(cmpxchg(&inode->i_wb, NULL, wb))) in __inode_attach_wb()
Dlocks.c228 if (cmpxchg(&inode->i_flctx, NULL, ctx)) { in locks_get_lock_context()
Dbuffer.c1508 b_state_old = cmpxchg(&bh->b_state, b_state, in discard_buffer()
/linux-4.4.14/drivers/target/iscsi/
Discsi_target.c4255 cmpxchg(&conn->tx_thread_active, true, false)) { in iscsit_close_connection()
4261 cmpxchg(&conn->rx_thread_active, true, false)) { in iscsit_close_connection()
4557 sleep = cmpxchg(&conn->tx_thread_active, true, false); in iscsit_logout_post_handler_closesession()
4574 sleep = cmpxchg(&conn->tx_thread_active, true, false); in iscsit_logout_post_handler_samecid()
/linux-4.4.14/drivers/staging/rdma/hfi1/
Druc.c525 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in ruc_loopback()
Drc.c2298 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr, in hfi1_rc_rcv()
/linux-4.4.14/drivers/net/ethernet/broadcom/bnx2x/
Dbnx2x.h656 prev = cmpxchg(&fp->busy_poll_state, old, BNX2X_STATE_FP_NAPI); in bnx2x_fp_lock_napi()
674 return cmpxchg(&fp->busy_poll_state, 0, BNX2X_STATE_FP_POLL) == 0; in bnx2x_fp_lock_poll()
/linux-4.4.14/arch/powerpc/xmon/
Dxmon.c358 last_speaker = cmpxchg(&xmon_speaker, 0, me); in get_output_lock()
374 prev = cmpxchg(&xmon_speaker, last_speaker, me); in get_output_lock()
/linux-4.4.14/arch/sparc/
DKconfig215 Sparc32 does not have a CAS instruction like sparc64. cmpxchg()
/linux-4.4.14/drivers/gpu/drm/armada/
Darmada_crtc.c219 ret = cmpxchg(&plane->work, NULL, work) ? -EBUSY : 0; in armada_drm_plane_work_queue()
/linux-4.4.14/drivers/net/ethernet/chelsio/cxgb3/
Dcxgb3_offload.c633 (void)cmpxchg(&t->tid_tab[tid].ctx, ctx, NULL); in cxgb3_remove_tid()
/linux-4.4.14/kernel/sched/
Dcore.c462 __old = cmpxchg((ptr), __val, __val | (val)); \
498 old = cmpxchg(&ti->flags, val, val | _TIF_NEED_RESCHED); in set_nr_if_polling()
533 if (cmpxchg(&node->next, NULL, WAKE_Q_TAIL)) in wake_q_add()
Dfair.c2195 if (cmpxchg(&mm->numa_next_scan, migrate, next_scan) != migrate) in task_numa_work()
/linux-4.4.14/net/sunrpc/auth_gss/
Dsvcauth_gss.c1279 ret = cmpxchg(&sn->use_gss_proxy, -1, type); in set_gss_proxy()
/linux-4.4.14/net/netfilter/ipvs/
Dip_vs_sync.c528 n = cmpxchg(&cp->sync_endtime, orig, n); in ip_vs_sync_conn_needed()
/linux-4.4.14/drivers/block/drbd/
Ddrbd_worker.c1945 } while (cmpxchg(flags, old, new) != old); in get_work_bits()
/linux-4.4.14/fs/btrfs/
Draid56.c240 x = cmpxchg(&info->stripe_hash_table, NULL, table); in btrfs_alloc_stripe_hash_table()
Dinode.c3342 if (cmpxchg(&root->orphan_cleanup_state, 0, ORPHAN_CLEANUP_STARTED)) in btrfs_orphan_cleanup()
/linux-4.4.14/drivers/target/
Dtarget_core_transport.c615 if (cmpxchg(&cmd->lun_ref_active, true, false)) in transport_lun_remove_cmd()
/linux-4.4.14/drivers/md/bcache/
Dbtree.c841 old = cmpxchg(&c->btree_cache_alloc_lock, NULL, current); in mca_cannibalize_lock()
/linux-4.4.14/virt/kvm/
Dkvm_main.c199 cmpxchg(&kvm->tlbs_dirty, dirty_count, 0); in kvm_flush_remote_tlbs()
/linux-4.4.14/drivers/usb/gadget/function/
Df_fs.c88 cmpxchg(&ffs->setup_state, FFS_SETUP_CANCELLED, FFS_NO_SETUP); in ffs_setup_state_clear_cancelled()
/linux-4.4.14/
DMAINTAINERS2956 M: Johannes Weiner <hannes@cmpxchg.org>
2976 M: Johannes Weiner <hannes@cmpxchg.org>