Lines Matching +full:flags +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0
11 * cpumask_next - get the next cpu in a cpumask
19 /* -1 is a legal arg here. */ in cpumask_next()
20 if (n != -1) in cpumask_next()
27 * cpumask_next_and - get the next cpu in *src1p & *src2p
37 /* -1 is a legal arg here. */ in cpumask_next_and()
38 if (n != -1) in cpumask_next_and()
46 * cpumask_any_but - return a "random" in a cpumask, but not this one.
47 * @mask: the cpumask to search
50 * Often used to find any cpu but smp_processor_id() in a mask.
53 int cpumask_any_but(const struct cpumask *mask, unsigned int cpu) in cpumask_any_but() argument
58 for_each_cpu(i, mask) in cpumask_any_but()
66 * cpumask_next_wrap - helper to implement for_each_cpu_wrap
68 * @mask: the cpumask pointer
75 * we cannot assume @start is set in @mask.
77 int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap) in cpumask_next_wrap() argument
82 next = cpumask_next(n, mask); in cpumask_next_wrap()
89 n = -1; in cpumask_next_wrap()
100 * alloc_cpumask_var_node - allocate a struct cpumask on a given node
101 * @mask: pointer to cpumask_var_t where the cpumask is returned
102 * @flags: GFP_ flags
108 * In addition, mask will be NULL if this fails. Note that gcc is
109 * usually smart enough to know that mask can never be NULL if
113 bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) in alloc_cpumask_var_node() argument
115 *mask = kmalloc_node(cpumask_size(), flags, node); in alloc_cpumask_var_node()
118 if (!*mask) { in alloc_cpumask_var_node()
124 return *mask != NULL; in alloc_cpumask_var_node()
128 bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) in zalloc_cpumask_var_node() argument
130 return alloc_cpumask_var_node(mask, flags | __GFP_ZERO, node); in zalloc_cpumask_var_node()
135 * alloc_cpumask_var - allocate a struct cpumask
136 * @mask: pointer to cpumask_var_t where the cpumask is returned
137 * @flags: GFP_ flags
144 bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) in alloc_cpumask_var() argument
146 return alloc_cpumask_var_node(mask, flags, NUMA_NO_NODE); in alloc_cpumask_var()
150 bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) in zalloc_cpumask_var() argument
152 return alloc_cpumask_var(mask, flags | __GFP_ZERO); in zalloc_cpumask_var()
157 * alloc_bootmem_cpumask_var - allocate a struct cpumask from the bootmem arena.
158 * @mask: pointer to cpumask_var_t where the cpumask is returned
162 * Either returns an allocated (zero-filled) cpumask, or causes the
165 void __init alloc_bootmem_cpumask_var(cpumask_var_t *mask) in alloc_bootmem_cpumask_var() argument
167 *mask = memblock_alloc(cpumask_size(), SMP_CACHE_BYTES); in alloc_bootmem_cpumask_var()
168 if (!*mask) in alloc_bootmem_cpumask_var()
174 * free_cpumask_var - frees memory allocated for a struct cpumask.
175 * @mask: cpumask to free
177 * This is safe on a NULL mask.
179 void free_cpumask_var(cpumask_var_t mask) in free_cpumask_var() argument
181 kfree(mask); in free_cpumask_var()
186 * free_bootmem_cpumask_var - frees result of alloc_bootmem_cpumask_var
187 * @mask: cpumask to free
189 void __init free_bootmem_cpumask_var(cpumask_var_t mask) in free_bootmem_cpumask_var() argument
191 memblock_free_early(__pa(mask), cpumask_size()); in free_bootmem_cpumask_var()
196 * cpumask_local_spread - select the i'th cpu with local numa cpu's first
201 * local cpus are returned first, followed by non-local ones, then it
215 if (i-- == 0) in cpumask_local_spread()
220 if (i-- == 0) in cpumask_local_spread()
228 if (i-- == 0) in cpumask_local_spread()