summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-20 11:41:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-20 11:41:46 -0700
commitae814200e8393fa504dd246e98fcba8f5493de28 (patch)
tree9e49a70e51ba3be1d2c36ffc3cc9d391f1d0ad68 /include/linux
parent216b3f432a36549767ca750e64badd71340b8c0f (diff)
parentf4806cc63cc65bd752fd72d84937614dca6504ec (diff)
Merge tag 'bitmap-for-7.3' of https://github.com/norov/linux
Pull bitmap updates from Yury Norov: "The usual set of fixes, cleanups and performance improvements together with a couple of new tests: - bitmap_find_next_zero_area_off() optimization (Sunyi) - bitmap_find_next_zero_area_off(): return size when no zero area is found (Yury) - bitmap vs IDA vs Maple Tree performance test (Yury) - get rid of cpumap_print_to_pagebuf() (Yury) - use nr_node_ids in __nodemask_pr_numnodes() (Li RongQing) - bitops: make the *_bit_le functions use unsigned long (Benjamin) - bitmap scatter & gather test fix (Christophe) - use __ASSEMBLER__ in bitmap header files (Thomas)" * tag 'bitmap-for-7.3' of https://github.com/norov/linux: (25 commits) lib: test bitmap vs IDA vs Maple Tree performance for region allocations bitmap: Return size when no zero area is found media: s5p-mfc: Treat bitmap size as allocation failure crypto: ccp: Treat bitmap size as allocation failure powerpc/msi: Treat bitmap size as allocation failure ARM: dma-mapping: Treat bitmap size as allocation failure bitmap: drop bitmap_next_set_region() nodemask: reduce bitmap width to nr_node_ids in __nodemask_pr_numnodes() bitmap: Properly initialise destination bitmap for scatter & gather test lib/bitmap-str: get rid of cpumap_print_to_pagebuf() perf: Use sysfs_emit() for cpumask show callbacks PCI/sysfs: Use sysfs_emit() for cpumask show callbacks RDMA/hfi1: Use sysfs_emit() for cpumask show helper hwtracing: hisi_ptt: Use sysfs_emit() for cpumask show fpga: dfl-fme-perf: Use sysfs_emit() for cpumask show devfreq: Use sysfs_emit() for cpumask show callbacks cpu: Use sysfs_emit() for cpumask show callback x86/events: Use sysfs_emit() for cpumask show callbacks powerpc: Use sysfs_emit() for cpumask show callbacks arm: Use sysfs_emit() for cpumask show callbacks ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitmap.h15
-rw-r--r--include/linux/bits.h6
-rw-r--r--include/linux/cpumask.h19
-rw-r--r--include/linux/nodemask.h15
4 files changed, 17 insertions, 38 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index b007d54a9036..7df1573a409c 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -2,7 +2,7 @@
#ifndef __LINUX_BITMAP_H
#define __LINUX_BITMAP_H
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <linux/align.h>
#include <linux/bitops.h>
@@ -209,6 +209,9 @@ unsigned long bitmap_find_next_zero_area_off(unsigned long *map,
* The @align_mask should be one less than a power of 2; the effect is that
* the bit offset of all zero areas this function finds is multiples of that
* power of 2. A @align_mask of 0 means no alignment is required.
+ *
+ * Return: The bit offset of the found area or a value >= @size
+ * if no area is found.
*/
static __always_inline
unsigned long bitmap_find_next_zero_area(unsigned long *map,
@@ -697,14 +700,6 @@ void bitmap_gather(unsigned long *dst, const unsigned long *src,
__assign_bit(n++, dst, test_bit(bit, src));
}
-static __always_inline
-void bitmap_next_set_region(unsigned long *bitmap, unsigned int *rs,
- unsigned int *re, unsigned int end)
-{
- *rs = find_next_bit(bitmap, end, *rs);
- *re = find_next_zero_bit(bitmap, end, *rs + 1);
-}
-
/**
* bitmap_release_region - release allocated bitmap region
* @bitmap: array of unsigned longs corresponding to the bitmap
@@ -894,6 +889,6 @@ void bitmap_write(unsigned long *map, unsigned long value,
#define bitmap_set_value8(map, value, start) \
bitmap_write(map, value, start, BITS_PER_BYTE)
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
#endif /* __LINUX_BITMAP_H */
diff --git a/include/linux/bits.h b/include/linux/bits.h
index a40cc861b3a7..b7509f15718e 100644
--- a/include/linux/bits.h
+++ b/include/linux/bits.h
@@ -17,7 +17,7 @@
* position @h. For example
* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
*/
-#if !defined(__ASSEMBLY__)
+#if !defined(__ASSEMBLER__)
/*
* Missing asm support
@@ -75,7 +75,7 @@
#define BIT_U32(nr) BIT_TYPE(u32, nr)
#define BIT_U64(nr) BIT_TYPE(u64, nr)
-#else /* defined(__ASSEMBLY__) */
+#else /* defined(__ASSEMBLER__) */
/*
* BUILD_BUG_ON_ZERO is not available in h files included from asm files,
@@ -84,6 +84,6 @@
#define GENMASK(h, l) __GENMASK(h, l)
#define GENMASK_ULL(h, l) __GENMASK_ULL(h, l)
-#endif /* !defined(__ASSEMBLY__) */
+#endif /* !defined(__ASSEMBLER__) */
#endif /* __LINUX_BITS_H */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index d3cda0544954..4c8bb6953107 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -13,7 +13,6 @@
#include <linux/cpumask_types.h>
#include <linux/gfp_types.h>
#include <linux/numa.h>
-#include <linux/sprintf.h>
#include <linux/threads.h>
#include <linux/types.h>
#include <vdso/page.h>
@@ -1316,24 +1315,6 @@ static __always_inline bool cpu_dying(unsigned int cpu)
#endif /* NR_CPUS > BITS_PER_LONG */
/**
- * cpumap_print_to_pagebuf - copies the cpumask into the buffer either
- * as comma-separated list of cpus or hex values of cpumask
- * @list: indicates whether the cpumap must be list
- * @mask: the cpumask to copy
- * @buf: the buffer to copy into
- *
- * Return: the length of the (null-terminated) @buf string, zero if
- * nothing is copied.
- */
-static __always_inline ssize_t
-cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
-{
- /* Opencode offset_in_page(buf) to not include linux/mm.h */
- return scnprintf(buf, PAGE_SIZE - ((unsigned long)buf & ~PAGE_MASK),
- list ? "%*pbl\n" : "%*pb\n", cpumask_pr_args(mask));
-}
-
-/**
* cpumap_print_bitmask_to_buf - copies the cpumask into the buffer as
* hex values of cpumask
*
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index b842aa525546..607373bd83ee 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -95,6 +95,14 @@
extern nodemask_t _unused_nodemask_arg_;
+#if MAX_NUMNODES > 1
+extern unsigned int nr_node_ids;
+extern unsigned int nr_online_nodes;
+#else
+#define nr_node_ids 1U
+#define nr_online_nodes 1U
+#endif
+
/**
* nodemask_pr_args - printf args to output a nodemask
* @maskp: nodemask to be printed
@@ -105,7 +113,7 @@ extern nodemask_t _unused_nodemask_arg_;
__nodemask_pr_bits(maskp)
static __always_inline unsigned int __nodemask_pr_numnodes(const nodemask_t *m)
{
- return m ? MAX_NUMNODES : 0;
+ return m ? nr_node_ids : 0;
}
static __always_inline const unsigned long *__nodemask_pr_bits(const nodemask_t *m)
{
@@ -438,9 +446,6 @@ static __always_inline unsigned int next_memory_node(int nid)
return next_node(nid, node_states[N_MEMORY]);
}
-extern unsigned int nr_node_ids;
-extern unsigned int nr_online_nodes;
-
static __always_inline void node_set_online(int nid)
{
node_set_state(nid, N_ONLINE);
@@ -480,8 +485,6 @@ static __always_inline int num_node_state(enum node_states state)
#define first_memory_node 0
#define next_online_node(nid) (MAX_NUMNODES)
#define next_memory_node(nid) (MAX_NUMNODES)
-#define nr_node_ids 1U
-#define nr_online_nodes 1U
#define node_set_online(node) node_set_state((node), N_ONLINE)
#define node_set_offline(node) node_clear_state((node), N_ONLINE)