| /linux/lib/ |
| H A D | llist.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Lock-less NULL terminated single linked list 6 * architectures that don't have NMI-safe cmpxchg implementation, the 18 * llist_del_first - delete the first entry of lock-less list 19 * @head: the head for your lock-less list 25 * multiple llist_add users without lock. Because otherwise 27 * llist_add) sequence in another user may change @head->first->next, 28 * but keep @head->first. If multiple consumers are needed, please 29 * use llist_del_all or use lock between consumers. 35 entry = smp_load_acquire(&head->first); in llist_del_first() [all …]
|
| H A D | percpu_counter.c | 1 // SPDX-License-Identifier: GPL-2.0 65 raw_spin_lock_irqsave(&fbc->lock, flags); in percpu_counter_set() 67 s32 *pcount = per_cpu_ptr(fbc->counters, cpu); in percpu_counter_set() 70 fbc->count = amount; in percpu_counter_set() 71 raw_spin_unlock_irqrestore(&fbc->lock, flags); in percpu_counter_set() 83 * the this_cpu_add(), and the interrupt updates this_cpu(*fbc->counters), 90 * 1. the fast path uses local cmpxchg (note: no lock prefix) 98 count = this_cpu_read(*fbc->counters); in percpu_counter_add_batch() 101 raw_spin_lock_irqsave(&fbc->lock, flags); in percpu_counter_add_batch() 106 count = __this_cpu_read(*fbc->counters); in percpu_counter_add_batch() [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | rbtree.c | 1 // SPDX-License-Identifier: GPL-2.0 25 long less_callback_ran = -1; 26 long removed_key = -1; 27 long first_data[2] = {-1, -1}; 36 static bool less(struct bpf_rb_node *a, const struct bpf_rb_node *b) in less() function 45 return node_a->key < node_b->key; in less() 48 static long __add_three(struct bpf_rb_root *root, struct bpf_spin_lock *lock) in __add_three() argument 55 n->key = 5; in __add_three() 62 m->key = 1; in __add_three() 64 bpf_spin_lock(lock); in __add_three() [all …]
|
| H A D | refcounted_kptr.c | 1 // SPDX-License-Identifier: GPL-2.0 41 private(A) struct bpf_spin_lock lock; variable 51 static bool less(struct bpf_rb_node *node_a, const struct bpf_rb_node *node_b) in less() function 59 return a->key < b->key; in less() 70 return node_a->key < node_b->key; in less_a() 75 struct bpf_spin_lock *lock) in __insert_in_tree_and_list() argument 81 return -1; in __insert_in_tree_and_list() 84 m->key = 123; in __insert_in_tree_and_list() 85 m->list_data = 456; in __insert_in_tree_and_list() 87 bpf_spin_lock(lock); in __insert_in_tree_and_list() [all …]
|
| H A D | refcounted_kptr_fail.c | 1 // SPDX-License-Identifier: GPL-2.0 23 static bool less(struct bpf_rb_node *a, const struct bpf_rb_node *b) in less() function 31 return node_a->key < node_b->key; in less() 35 __failure __msg("Unreleased reference id=4 alloc_insn={{[0-9]+}}") 45 bpf_rbtree_add(&groot, &n->node, less); in rbtree_refcounted_node_ref_escapes() 52 m->key = 2; in rbtree_refcounted_node_ref_escapes() 76 __failure __msg("Unreleased reference id=3 alloc_insn={{[0-9]+}}") 87 m->key = 2; in rbtree_refcounted_node_ref_escapes_owning_input() 90 bpf_rbtree_add(&groot, &n->node, less); in rbtree_refcounted_node_ref_escapes_owning_input() 97 __failure __msg("function calls are not allowed while holding a lock") [all …]
|
| H A D | rbtree_fail.c | 1 // SPDX-License-Identifier: GPL-2.0 20 static bool less(struct bpf_rb_node *a, const struct bpf_rb_node *b) in less() function 28 return node_a->key < node_b->key; in less() 41 bpf_rbtree_add(&groot, &n->node, less); in rbtree_api_nolock_add() 56 bpf_rbtree_add(&groot, &n->node, less); in rbtree_api_nolock_remove() [all...] |
| /linux/drivers/md/dm-vdo/ |
| H A D | memory-alloc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 13 #include "memory-alloc.h" 38 * @flag_ptr: Location of the allocation-allowed flag 71 * performance-critical stage for us, so a linked list should be fine. 80 spinlock_t lock; member 101 spin_lock_irqsave(&memory_stats.lock, flags); in add_kmalloc_block() 105 spin_unlock_irqrestore(&memory_stats.lock, flags); in add_kmalloc_block() 112 spin_lock_irqsave(&memory_stats.lock, flags); in remove_kmalloc_block() 113 memory_stats.kmalloc_blocks--; in remove_kmalloc_block() 114 memory_stats.kmalloc_bytes -= size; in remove_kmalloc_block() [all …]
|
| H A D | recovery-journal.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 13 #include "admin-state.h" 19 #include "wait-queue.h" 30 * The concurrency guarantees of this single-threaded model allow the code to omit more 31 * fine-grained locking for recovery journal structures. 33 * The journal consists of a set of on-disk blocks arranged as a circular log with monotonically 36 * half-open interval containing the active blocks. 'active' is the number of the block actively 38 * = active + 1, and head may be any value in the interval [tail - size, active]. 40 * The journal also contains a set of in-memory blocks which are used to buffer up entries until 41 * they can be committed. In general the number of in-memory blocks ('tail_buffer_count') will be [all …]
|
| /linux/arch/mips/include/asm/octeon/ |
| H A D | cvmx-bootmem.h | 7 * Copyright (c) 2003-2008 Cavium Networks 14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 100 uint32_t lock; member 126 uint32_t lock; 151 * address. This is an allocate-only algorithm, so 158 * @alignment: Alignment required - must be power of 2 181 * @alignment: Alignment required - must be power of 2 182 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes 201 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes [all …]
|
| /linux/tools/perf/pmu-events/arch/x86/lunarlake/ |
| H A D | other.json | 3 …sed (through a software handler) beyond FP; SSE-AVX mix and A/D assists who are counted by dedicat… 7 …-AVX mix and A/D assists who are counted by dedicated sub-events. This includes, but not limited … 22 …"BriefDescription": "Counts the number of unhalted cycles a Core is blocked due to a lock In Progr… 26 …"PublicDescription": "Counts the number of unhalted cycles a Core is blocked due to a lock In Prog… 32 …lted cycles a Core is blocked due to an Accepted lock it issued, includes both split and non-split… 36 …lted cycles a Core is blocked due to an Accepted lock it issued, includes both split and non-split… 42 …"BriefDescription": "Counts the number of non-split locks such as UC locks issued by a Core (does … 129 …"BriefDescription": "Counts partial streaming stores (less than 64 bytes, WCiL) that have any type… 135 …"PublicDescription": "Counts partial streaming stores (less than 64 bytes, WCiL) that have any typ…
|
| /linux/Documentation/bpf/ |
| H A D | graph_ds_impl.rst | 5 This document describes implementation details of new-style "graph" data 22 ------------ 26 with the map API (HASH, ARRAY), others less so. Consequently, programs 31 no longer relevant. With the introduction of kfuncs, kptrs, and the any-context 35 Two such data structures - linked_list and rbtree - have many verification 44 ------------ 47 helper functions - either standard map API helpers like ``bpf_map_update_elem`` 48 or map-specific helpers. The new-style graph data structures instead use kfuncs 57 ------- 59 The new-style data structures are intrusive and are defined similarly to their [all …]
|
| /linux/drivers/clk/samsung/ |
| H A D | clk-cpu.c | 1 // SPDX-License-Identifier: GPL-2.0-only 37 #include <linux/clk-provider.h> 40 #include "clk-cpu.h" 48 * struct exynos_cpuclk_regs - Register offsets for CPU related clocks 71 * struct exynos_cpuclk_chip - Chip specific data for CPU clock 83 * struct exynos_cpuclk - information about clock supplied to a CPU core 88 * @lock: cpu clock domain register access lock 94 * @chip: chip-specific data for the CPU clock 103 spinlock_t *lock; member 111 /* ---- Common code --------------------------------------------------------- */ [all …]
|
| /linux/arch/powerpc/kvm/ |
| H A D | book3s_xics.c | 1 // SPDX-License-Identifier: GPL-2.0-only 39 * Each ICS has a spin lock protecting the information about the IRQ 50 * - To speed up resends, keep a bitmap of "resend" set bits in the 53 * - Speed up server# -> ICP lookup (array ? hash table ?) 55 * - Make ICS lockless as well, or at least a per-interrupt lock or hashed 59 /* -- ICS routines -- */ 81 return -EINVAL; in ics_deliver_irq() 83 state = &ics->irq_state[src]; in ics_deliver_irq() 84 if (!state->exists) in ics_deliver_irq() 85 return -EINVAL; in ics_deliver_irq() [all …]
|
| H A D | book3s_hv_rm_xics.c | 1 // SPDX-License-Identifier: GPL-2.0-only 19 #include <asm/ppc-opcode.h> 20 #include <asm/pnv-pci.h> 37 /* -- ICS routines -- */ 44 struct ics_irq_state *state = &ics->irq_state[i]; in ics_rm_check_resend() 45 if (state->resend) in ics_rm_check_resend() 46 icp_rm_deliver_irq(xics, icp, state->number, true); in ics_rm_check_resend() 51 /* -- ICP routines -- */ 59 kvmppc_host_rm_ops_hv->rm_core[hcore].rm_data = vcpu; in icp_send_hcore_msg() 78 * Returns -1, if no CPU could be found in the host [all …]
|
| /linux/kernel/locking/ |
| H A D | ww_mutex.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 9 __ww_waiter_first(struct mutex *lock) in __ww_waiter_first() argument 13 w = list_first_entry(&lock->wait_list, struct mutex_waiter, list); in __ww_waiter_first() 14 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_first() 21 __ww_waiter_next(struct mutex *lock, struct mutex_waiter *w) in __ww_waiter_next() argument 24 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_next() 31 __ww_waiter_prev(struct mutex *lock, struct mutex_waiter *w) in __ww_waiter_prev() argument 34 if (list_entry_is_head(w, &lock->wait_list, list)) in __ww_waiter_prev() 41 __ww_waiter_last(struct mutex *lock) in __ww_waiter_last() argument 45 w = list_last_entry(&lock->wait_list, struct mutex_waiter, list); in __ww_waiter_last() [all …]
|
| /linux/include/linux/ |
| H A D | processor.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 9 * spin_begin is used before beginning a busy-wait loop, and must be paired 16 * of these primitives. It should not lock or take any other resource. 21 * less than the cost of a context switch (and associated overhead). 23 * Detection of resource owner and decision to spin or sleep or guest-yield 24 * (e.g., spin lock holder vcpu preempted, or mutex owner not on CPU) can be
|
| H A D | tty_buffer.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 18 unsigned int lookahead; /* Lazy update on recv, can become less than "read" */ 27 return b->data + ofs; in char_buf_ptr() 32 return char_buf_ptr(b, ofs) + b->size; in flag_buf_ptr() 38 struct mutex lock; member 42 atomic_t mem_used; /* In-use buffers excluding free list */
|
| /linux/kernel/rcu/ |
| H A D | Kconfig.debug | 1 # SPDX-License-Identifier: GPL-2.0-only 3 # RCU-related debugging configuration options 19 false-positive splats, we keep it default disabled but once all 63 Note that PREEMPT_COUNT must be enabled if the preempt-disabled 64 and bh-disabled checks are to take effect, and that PREEMPT_RCU 65 must be enabled for the RCU-nesting checks to take effect. 78 log of failure/close-call rcutorture reader segments with the 82 less probable. 88 bool "Log grace-period numbers for rcutorture failures" 93 log of failure/close-call rcutorture reader segments with the [all …]
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | multigen_lru.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 Multi-Gen LRU 6 The multi-gen LRU is an alternative LRU implementation that optimizes 26 ----------- 38 0x0001 The main switch for the multi-gen LRU. 41 theoretically worsen lock contention (mmap_lock). If it is 42 disabled, the multi-gen LRU will suffer a minor performance 46 0x0004 Clearing the accessed bit in non-leaf page table entries as 49 disabled, the multi-gen LRU will suffer a negligible 65 -------------------- [all …]
|
| /linux/net/netfilter/ |
| H A D | nft_set_rbtree.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2008-2009 Patrick McHardy <kaber@trash.net> 20 rwlock_t lock; member 33 return nft_set_ext_exists(&rbe->ext, NFT_SET_EXT_FLAGS) && in nft_rbtree_interval_end() 34 (*nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END); in nft_rbtree_interval_end() 46 return memcmp(nft_set_ext_key(&e1->ext), nft_set_ext_key(&e2->ext), in nft_rbtree_cmp() 47 set->klen); in nft_rbtree_cmp() 52 return nft_set_elem_expired(&rbe->ext); in nft_rbtree_elem_expired() 65 parent = rcu_dereference_raw(priv->root.rb_node); in __nft_rbtree_lookup() 67 if (read_seqcount_retry(&priv->count, seq)) in __nft_rbtree_lookup() [all …]
|
| /linux/drivers/usb/gadget/function/ |
| H A D | f_mass_storage.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 36 "true to force read-only"); \ 40 "true to simulate CD-ROM instead of disk"); \ 83 struct mutex lock; member 105 const char *vendor_name; /* 8 characters or less */ 106 const char *product_name; /* 16 characters or less */
|
| /linux/Documentation/RCU/ |
| H A D | checklist.rst | 1 .. SPDX-License-Identifier: GPL-2.0 14 0. Is RCU being applied to a read-mostly situation? If the data 18 tool for the job. Yes, RCU does reduce read-side overhead by 19 increasing write-side overhead, which is exactly why normal uses 27 Yet another exception is where the low real-time latency of RCU's 28 read-side primitives is critically important. 33 counter-intuitive situation where rcu_read_lock() and 49 them -- even x86 allows later loads to be reordered to precede 59 2. Do the RCU read-side critical sections make proper use of 63 under your read-side code, which can greatly increase the [all …]
|
| /linux/Documentation/driver-api/usb/ |
| H A D | URB.rst | 1 .. _usb-urb: 6 :Revised: 2000-Dec-05 7 :Again: 2002-Jul-06 8 :Again: 2005-Sep-19 9 :Again: 2017-Mar-29 14 The USB subsystem now has a substantial section at :ref:`usb-hostside-api` 26 - An URB consists of all relevant information to execute any USB transaction 29 - Execution of an URB is inherently an asynchronous operation, i.e. the 33 - Transfers for one URB can be canceled with :c:func:`usb_unlink_urb` 36 - Each URB has a completion handler, which is called after the action [all …]
|
| /linux/Documentation/devicetree/bindings/soc/fsl/ |
| H A D | fsl,bman-portal.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/soc/fsl/fsl,bman-portal.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Frank Li <Frank.Li@nxp.com> 15 Portals are memory mapped interfaces to BMan that allow low-latency, lock-less 22 - const: fsl,bman-portal 23 - items: 24 - enum: 25 - fsl,bman-portal-1.0.0 [all …]
|
| /linux/Documentation/core-api/ |
| H A D | idr.rst | 1 .. SPDX-License-Identifier: GPL-2.0+ 18 only ID allocation, and as a result is much more memory-efficient. 46 idr_alloc_cyclic(). The IDR becomes less efficient when dealing 50 either use the callback-based idr_for_each() or the 51 iterator-style idr_for_each_entry(). You may need to use 63 If you need to take a lock while allocating a new ID from the IDR, 66 you can call idr_preload() before taking the lock, and then 69 .. kernel-doc:: include/linux/idr.h 75 .. kernel-doc:: lib/idr.c 81 .. kernel-doc:: include/linux/idr.h [all …]
|