We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c56f97c commit 012b104Copy full SHA for 012b104
include/linux/cpumask.h
@@ -354,6 +354,18 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *src)
354
return find_next_bit_wrap(cpumask_bits(src), small_cpumask_bits, n + 1);
355
}
356
357
+/**
358
+ * cpumask_random - get random cpu in *src.
359
+ * @src: cpumask pointer
360
+ *
361
+ * Return: random set bit, or >= nr_cpu_ids if @src is empty.
362
+ */
363
+static __always_inline
364
+unsigned int cpumask_random(const struct cpumask *src)
365
+{
366
+ return find_random_bit(cpumask_bits(src), nr_cpu_ids);
367
+}
368
+
369
/**
370
* for_each_cpu - iterate over every cpu in a mask
371
* @cpu: the (optionally unsigned) integer iterator
0 commit comments