projects/linux·commit ae814200

Merge tag 'bitmap-for-7.3' of https://github.com/norov/linux

ae814200 · Linus Torvalds <[email protected]> · 2026-08-20 11:41:46 -07:00

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
  ...
Commit
ae814200e8393fa504dd246e98fcba8f5493de28
Parents
216b3f43 · f4806cc6

Merge commit. Changes below are compared with the first parent: 216b3f43.

Changes

68 files changed · +402 −138

FileStatusAddDelContent
MAINTAINERSmodified+3−0View file
arch/arm/mach-imx/mmdc.cmodified+1−1View file
arch/arm/mm/cache-l2x0-pmu.cmodified+1−1View file
arch/arm/mm/dma-mapping.cmodified+2−2View file
arch/powerpc/kernel/cacheinfo.cmodified+2−1View file
arch/powerpc/perf/hv-24x7.cmodified+1−1View file
arch/powerpc/perf/hv-gpci.cmodified+1−1View file
arch/powerpc/perf/imc-pmu.cmodified+1−1View file
arch/powerpc/sysdev/msi_bitmap.cmodified+1−1View file
arch/x86/events/amd/iommu.cmodified+1−1View file
arch/x86/events/amd/power.cmodified+1−1View file
arch/x86/events/amd/uncore.cmodified+1−1View file
arch/x86/events/intel/core.cmodified+1−1View file
arch/x86/events/intel/uncore.cmodified+1−1View file
drivers/base/cpu.cmodified+1−1View file
drivers/crypto/ccp/ccp-dev-v3.cmodified+1−1View file
drivers/crypto/ccp/ccp-dev-v5.cmodified+1−1View file
drivers/devfreq/event/rockchip-dfi.cmodified+1−1View file
drivers/devfreq/hisi_uncore_freq.cmodified+1−1View file
drivers/firmware/psci/psci_checker.cmodified+2−13View file
drivers/fpga/dfl-fme-perf.cmodified+1−1View file
drivers/hwtracing/ptt/hisi_ptt.cmodified+1−1View file
drivers/infiniband/hw/hfi1/sdma.cmodified+2−1View file
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.cmodified+1−1View file
drivers/pci/pci-sysfs.cmodified+4−3View file
drivers/perf/alibaba_uncore_drw_pmu.cmodified+1−1View file
drivers/perf/amlogic/meson_ddr_pmu_core.cmodified+1−1View file
drivers/perf/arm-cci.cmodified+1−1View file
drivers/perf/arm-ccn.cmodified+1−1View file
drivers/perf/arm-cmn.cmodified+1−1View file
drivers/perf/arm-ni.cmodified+1−1View file
drivers/perf/arm_cspmu/arm_cspmu.cmodified+1−1View file
drivers/perf/arm_dmc620_pmu.cmodified+2−2View file
drivers/perf/arm_dsu_pmu.cmodified+1−1View file
drivers/perf/arm_pmu.cmodified+1−1View file
drivers/perf/arm_smmuv3_pmu.cmodified+1−1View file
drivers/perf/arm_spe_pmu.cmodified+1−1View file
drivers/perf/cxl_pmu.cmodified+1−1View file
drivers/perf/dwc_pcie_pmu.cmodified+1−1View file
drivers/perf/fsl_imx8_ddr_perf.cmodified+1−1View file
drivers/perf/fsl_imx9_ddr_perf.cmodified+1−1View file
drivers/perf/fujitsu_uncore_pmu.cmodified+1−1View file
drivers/perf/hisilicon/hisi_pcie_pmu.cmodified+1−1View file
drivers/perf/hisilicon/hisi_uncore_pmu.cmodified+1−1View file
drivers/perf/marvell_cn10k_ddr_pmu.cmodified+1−1View file
drivers/perf/marvell_cn10k_tad_pmu.cmodified+1−1View file
drivers/perf/marvell_pem_pmu.cmodified+1−1View file
drivers/perf/nvidia_t410_c2c_pmu.cmodified+1−1View file
drivers/perf/nvidia_t410_cmem_latency_pmu.cmodified+1−1View file
drivers/perf/qcom_l2_pmu.cmodified+1−1View file
drivers/perf/qcom_l3_pmu.cmodified+1−1View file
drivers/perf/starfive_starlink_pmu.cmodified+1−1View file
drivers/perf/thunderx2_pmu.cmodified+1−1View file
drivers/perf/xgene_pmu.cmodified+1−1View file
include/asm-generic/bitops/le.hmodified+9−9View file
include/linux/bitmap.hmodified+5−10View file
include/linux/bits.hmodified+3−3View file
include/linux/cpumask.hmodified+0−19View file
include/linux/nodemask.hmodified+9−6View file
kernel/events/core.cmodified+1−1View file
lib/Kconfig.debugmodified+13−0View file
lib/Makefilemodified+1−0View file
lib/bitmap-str.cmodified+4−5View file
lib/bitmap.cmodified+17−13View file
lib/find_bit_benchmark.cmodified+17−0View file
lib/region_alloc_benchmark.cadded+217−0View file
lib/test_bitmap.cmodified+39−0View file
tools/include/linux/bits.hmodified+3−3View file

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 0b64b5a..64dc2a2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4614,6 +4614,7 @@ F: lib/bitmap.c
F: lib/cpumask.c
F: lib/find_bit.c
F: lib/find_bit_benchmark.c
+F: lib/region_alloc_benchmark.c
F: lib/test_bitmap.c
F: lib/tests/cpumask_kunit.c
F: tools/include/linux/bitfield.h
@@ -15608,6 +15609,7 @@ F: Documentation/core-api/maple_tree.rst
F: include/linux/maple_tree.h
F: include/trace/events/maple_tree.h
F: lib/maple_tree.c
+F: lib/region_alloc_benchmark.c
F: lib/test_maple_tree.c
F: rust/helpers/maple_tree.c
F: rust/kernel/maple_tree.rs
@@ -29448,6 +29450,7 @@ F: Documentation/core-api/xarray.rst
F: include/linux/idr.h
F: include/linux/xarray.h
F: lib/idr.c
+F: lib/region_alloc_benchmark.c
F: lib/test_xarray.c
F: lib/xarray.c
F: tools/testing/radix-tree

arch/arm/mach-imx/mmdc.c

View file
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index b71467c..f6d993b 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -127,7 +127,7 @@ static ssize_t mmdc_pmu_cpumask_show(struct device *dev,
{
struct mmdc_pmu *pmu_mmdc = dev_get_drvdata(dev);
- return cpumap_print_to_pagebuf(true, buf, &pmu_mmdc->cpu);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu_mmdc->cpu));
}
static struct device_attribute mmdc_pmu_cpumask_attr =

arch/arm/mm/cache-l2x0-pmu.c

View file
diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c
index 3d9caf7..4782270 100644
--- a/arch/arm/mm/cache-l2x0-pmu.c
+++ b/arch/arm/mm/cache-l2x0-pmu.c
@@ -390,7 +390,7 @@ static struct attribute_group l2x0_pmu_event_attrs_group = {
static ssize_t l2x0_pmu_cpumask_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &pmu_cpu);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu_cpu));
}
static struct device_attribute l2x0_pmu_cpumask_attr =

arch/arm/mm/dma-mapping.c

View file
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f9bc53b..7761099 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -773,7 +773,7 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
start = bitmap_find_next_zero_area(mapping->bitmaps[i],
mapping->bits, 0, count, align);
- if (start > mapping->bits)
+ if (start >= mapping->bits)
continue;
bitmap_set(mapping->bitmaps[i], start, count);
@@ -794,7 +794,7 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
start = bitmap_find_next_zero_area(mapping->bitmaps[i],
mapping->bits, 0, count, align);
- if (start > mapping->bits) {
+ if (start >= mapping->bits) {
spin_unlock_irqrestore(&mapping->lock, flags);
return DMA_MAPPING_ERROR;
}

arch/powerpc/kernel/cacheinfo.c

View file
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 04e5ea3..cb09330 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -690,7 +690,8 @@ show_shared_cpumap(struct kobject *k, struct kobj_attribute *attr, char *buf, bo
mask = &cache->shared_cpu_map;
- return cpumap_print_to_pagebuf(list, buf, mask);
+ return sysfs_emit(buf, list ? "%*pbl\n" : "%*pb\n",
+ cpumask_pr_args(mask));
}
static ssize_t shared_cpu_map_show(struct kobject *k, struct kobj_attribute *attr, char *buf)

arch/powerpc/perf/hv-24x7.c

View file
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index abb4cfb..b0eedf1 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -429,7 +429,7 @@ static char *memdup_to_str(char *maybe_str, int max_len, gfp_t gfp)
static ssize_t cpumask_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &hv_24x7_cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&hv_24x7_cpumask));
}
static ssize_t sockets_show(struct device *dev,

arch/powerpc/perf/hv-gpci.c

View file
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
index 7269273..7649574 100644
--- a/arch/powerpc/perf/hv-gpci.c
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -100,7 +100,7 @@ static ssize_t kernel_version_show(struct device *dev,
static ssize_t cpumask_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &hv_gpci_cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&hv_gpci_cpumask));
}
/* Interface attribute array index to store system information */

arch/powerpc/perf/imc-pmu.c

View file
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 1d2db6d..f401181 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -117,7 +117,7 @@ static ssize_t imc_pmu_cpumask_get_attr(struct device *dev,
return 0;
}
- return cpumap_print_to_pagebuf(true, buf, active_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(active_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, imc_pmu_cpumask_get_attr, NULL);

arch/powerpc/sysdev/msi_bitmap.c

View file
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 456a4f6..2f38d4b 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -21,7 +21,7 @@ int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num)
offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0,
num, (1 << order) - 1);
- if (offset > bmp->irq_count)
+ if (offset >= bmp->irq_count)
goto err;
bitmap_set(bmp->bitmap, offset, num);

arch/x86/events/amd/iommu.c

View file
diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c
index 07b110e..f332c70 100644
--- a/arch/x86/events/amd/iommu.c
+++ b/arch/x86/events/amd/iommu.c
@@ -137,7 +137,7 @@ static ssize_t _iommu_cpumask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &iommu_cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&iommu_cpumask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, _iommu_cpumask_show, NULL);

arch/x86/events/amd/power.c

View file
diff --git a/arch/x86/events/amd/power.c b/arch/x86/events/amd/power.c
index 744dffa..6619721 100644
--- a/arch/x86/events/amd/power.c
+++ b/arch/x86/events/amd/power.c
@@ -150,7 +150,7 @@ static void pmu_event_read(struct perf_event *event)
static ssize_t
get_attr_cpumask(struct device *dev, struct device_attribute *attr, char *buf)
{
- return cpumap_print_to_pagebuf(true, buf, &cpu_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&cpu_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, get_attr_cpumask, NULL);

arch/x86/events/amd/uncore.c

View file
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 222dfab..7181973 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -353,7 +353,7 @@ static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
struct pmu *ptr = dev_get_drvdata(dev);
struct amd_uncore_pmu *pmu = container_of(ptr, struct amd_uncore_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->active_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->active_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, amd_uncore_attr_show_cpumask, NULL);

arch/x86/events/intel/core.c

View file
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 27cda71..cc13164 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -7590,7 +7590,7 @@ static ssize_t intel_hybrid_get_attr_cpus(struct device *dev,
struct x86_hybrid_pmu *pmu =
container_of(dev_get_drvdata(dev), struct x86_hybrid_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->supported_cpus);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->supported_cpus));
}
static DEVICE_ATTR(cpus, S_IRUGO, intel_hybrid_get_attr_cpus, NULL);

arch/x86/events/intel/uncore.c

View file
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 9f8a80c..b2109b3 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -861,7 +861,7 @@ static ssize_t uncore_get_attr_cpumask(struct device *dev,
{
struct intel_uncore_pmu *pmu = container_of(dev_get_drvdata(dev), struct intel_uncore_pmu, pmu);
- return cpumap_print_to_pagebuf(true, buf, &pmu->cpu_mask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&pmu->cpu_mask));
}
static DEVICE_ATTR(cpumask, S_IRUGO, uncore_get_attr_cpumask, NULL);

drivers/base/cpu.c

View file
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 19d288a..69e52fe 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -218,7 +218,7 @@ static ssize_t show_cpus_attr(struct device *dev,
{
struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr);
- return cpumap_print_to_pagebuf(true, buf, ca->map);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(ca->map));
}
#define _CPU_ATTR(name, map) \

drivers/crypto/ccp/ccp-dev-v3.c

View file
diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index fe69053..60a133e 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -28,7 +28,7 @@ static u32 ccp_alloc_ksb(struct ccp_cmd_queue *cmd_q, unsigned int count)
ccp->sb_count,
ccp->sb_start,
count, 0);
- if (start <= ccp->sb_count) {
+ if (start < ccp->sb_count) {
bitmap_set(ccp->sb, start, count);
mutex_unlock(&ccp->sb_mutex);

drivers/crypto/ccp/ccp-dev-v5.c

View file
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index 7b73332..dcd6aab 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -47,7 +47,7 @@ static u32 ccp_lsb_alloc(struct ccp_cmd_queue *cmd_q, unsigned int count)
MAX_LSB_CNT * LSB_SIZE,
0,
count, 0);
- if (start <= MAX_LSB_CNT * LSB_SIZE) {
+ if (start < MAX_LSB_CNT * LSB_SIZE) {
bitmap_set(ccp->lsbmap, start, count);
mutex_unlock(&ccp->sb_mutex);

drivers/devfreq/event/rockchip-dfi.c

View file
diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c
index 5e6e7e9..255aee1 100644
--- a/drivers/devfreq/event/rockchip-dfi.c
+++ b/drivers/devfreq/event/rockchip-dfi.c
@@ -354,7 +354,7 @@ static ssize_t ddr_perf_cpumask_show(struct device *dev,
struct pmu *pmu = dev_get_drvdata(dev);
struct rockchip_dfi *dfi = container_of(pmu, struct rockchip_dfi, pmu);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(dfi->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(dfi->cpu)));
}
static struct device_attribute ddr_perf_cpumask_attr =

drivers/devfreq/hisi_uncore_freq.c

View file
diff --git a/drivers/devfreq/hisi_uncore_freq.c b/drivers/devfreq/hisi_uncore_freq.c
index bef718d..e1f64b7 100644
--- a/drivers/devfreq/hisi_uncore_freq.c
+++ b/drivers/devfreq/hisi_uncore_freq.c
@@ -540,7 +540,7 @@ static ssize_t related_cpus_show(struct device *dev,
{
struct hisi_uncore_freq *uncore = dev_get_drvdata(dev->parent);
- return cpumap_print_to_pagebuf(true, buf, &uncore->related_cpus);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&uncore->related_cpus));
}
static DEVICE_ATTR_RO(related_cpus);

drivers/firmware/psci/psci_checker.c

View file
diff --git a/drivers/firmware/psci/psci_checker.c b/drivers/firmware/psci/psci_checker.c
index e67ba98..e045e92 100644
--- a/drivers/firmware/psci/psci_checker.c
+++ b/drivers/firmware/psci/psci_checker.c
@@ -186,7 +186,6 @@ static int hotplug_tests(void)
{
int i, nb_cpu_group, err = -ENOMEM;
cpumask_var_t offlined_cpus, *cpu_groups;
- char *page_buf;
if (!alloc_cpumask_var(&offlined_cpus, GFP_KERNEL))
return err;
@@ -194,10 +193,6 @@ static int hotplug_tests(void)
nb_cpu_group = alloc_init_cpu_groups(&cpu_groups);
if (nb_cpu_group < 0)
goto out_free_cpus;
- page_buf = (char *)__get_free_page(GFP_KERNEL);
- if (!page_buf)
- goto out_free_cpu_groups;
-
/*
* Of course the last CPU cannot be powered down and cpu_down() should
* refuse doing that.
@@ -210,17 +205,11 @@ static int hotplug_tests(void)
* off, the cpu group itself should shut down.
*/
for (i = 0; i < nb_cpu_group; ++i) {
- ssize_t len = cpumap_print_to_pagebuf(true, page_buf,
- cpu_groups[i]);
- /* Remove trailing newline. */
- page_buf[len - 1] = '\0';
- pr_info("Trying to turn off and on again group %d (CPUs %s)\n",
- i, page_buf);
+ pr_info("Trying to turn off and on again group %d (CPUs %*pbl)\n",
+ i, cpumask_pr_args(cpu_groups[i]));
err += down_and_up_cpus(cpu_groups[i], offlined_cpus);
}
- free_page((unsigned long)page_buf);
-out_free_cpu_groups:
free_cpu_groups(nb_cpu_group, &cpu_groups);
out_free_cpus:
free_cpumask_var(offlined_cpus);

drivers/fpga/dfl-fme-perf.c

View file
diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c
index 7422d2b..7aa4983 100644
--- a/drivers/fpga/dfl-fme-perf.c
+++ b/drivers/fpga/dfl-fme-perf.c
@@ -183,7 +183,7 @@ static ssize_t cpumask_show(struct device *dev,
priv = to_fme_perf_priv(pmu);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(priv->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(priv->cpu)));
}
static DEVICE_ATTR_RO(cpumask);

drivers/hwtracing/ptt/hisi_ptt.c

View file
diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index 94c371c..233c4c3 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -780,7 +780,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,
struct hisi_ptt *hisi_ptt = to_hisi_ptt(dev_get_drvdata(dev));
const cpumask_t *cpumask = cpumask_of_node(dev_to_node(&hisi_ptt->pdev->dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask));
}
static DEVICE_ATTR_RO(cpumask);

drivers/infiniband/hw/hfi1/sdma.c

View file
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index cfd9dd0..f253c8e 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -11,6 +11,7 @@
#include <linux/timer.h>
#include <linux/vmalloc.h>
#include <linux/highmem.h>
+#include <linux/sysfs.h>
#include "hfi.h"
#include "common.h"
@@ -1049,7 +1050,7 @@ ssize_t sdma_get_cpu_to_sde_map(struct sdma_engine *sde, char *buf)
if (cpumask_empty(&sde->cpu_mask))
snprintf(buf, PAGE_SIZE, "%s\n", "empty");
else
- cpumap_print_to_pagebuf(true, buf, &sde->cpu_mask);
+ sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&sde->cpu_mask));
mutex_unlock(&process_to_sde_mutex);
return strnlen(buf, PAGE_SIZE);
}

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c

View file
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c
index 5ba791f..b25ad2a 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr.c
@@ -43,7 +43,7 @@ int s5p_mfc_alloc_priv_buf(struct s5p_mfc_dev *dev, unsigned int mem_ctx,
if (dev->mem_virt) {
start = bitmap_find_next_zero_area(dev->mem_bitmap, bits, 0, count, align);
- if (start > bits)
+ if (start >= bits)
goto no_mem;
bitmap_set(dev->mem_bitmap, start, count);

drivers/pci/pci-sysfs.c

View file
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 5ec0b24..d608355 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -112,7 +112,8 @@ static ssize_t pci_dev_show_local_cpu(struct device *dev, bool list,
#else
mask = cpumask_of_pcibus(to_pci_dev(dev)->bus);
#endif
- return cpumap_print_to_pagebuf(list, buf, mask);
+ return sysfs_emit(buf, list ? "%*pbl\n" : "%*pb\n",
+ cpumask_pr_args(mask));
}
static ssize_t local_cpus_show(struct device *dev,
@@ -137,7 +138,7 @@ static ssize_t cpuaffinity_show(struct device *dev,
{
const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));
- return cpumap_print_to_pagebuf(false, buf, cpumask);
+ return sysfs_emit(buf, "%*pb\n", cpumask_pr_args(cpumask));
}
static DEVICE_ATTR_RO(cpuaffinity);
@@ -146,7 +147,7 @@ static ssize_t cpulistaffinity_show(struct device *dev,
{
const struct cpumask *cpumask = cpumask_of_pcibus(to_pci_bus(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask));
}
static DEVICE_ATTR_RO(cpulistaffinity);

drivers/perf/alibaba_uncore_drw_pmu.c

View file
diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c
index de77da8..fc934bc 100644
--- a/drivers/perf/alibaba_uncore_drw_pmu.c
+++ b/drivers/perf/alibaba_uncore_drw_pmu.c
@@ -221,7 +221,7 @@ static ssize_t ali_drw_pmu_cpumask_show(struct device *dev,
{
struct ali_drw_pmu *drw_pmu = to_ali_drw_pmu(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(drw_pmu->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(drw_pmu->cpu)));
}
static struct device_attribute ali_drw_pmu_cpumask_attr =

drivers/perf/amlogic/meson_ddr_pmu_core.c

View file
diff --git a/drivers/perf/amlogic/meson_ddr_pmu_core.c b/drivers/perf/amlogic/meson_ddr_pmu_core.c
index c1e755c..f614aa3 100644
--- a/drivers/perf/amlogic/meson_ddr_pmu_core.c
+++ b/drivers/perf/amlogic/meson_ddr_pmu_core.c
@@ -191,7 +191,7 @@ static ssize_t meson_ddr_perf_cpumask_show(struct device *dev,
{
struct ddr_pmu *pmu = dev_get_drvdata(dev);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(pmu->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(pmu->cpu)));
}
static struct device_attribute meson_ddr_perf_cpumask_attr =

drivers/perf/arm-cci.c

View file
diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c
index 1cc3214..f0ef0a6 100644
--- a/drivers/perf/arm-cci.c
+++ b/drivers/perf/arm-cci.c
@@ -1351,7 +1351,7 @@ static ssize_t pmu_cpumask_attr_show(struct device *dev,
struct pmu *pmu = dev_get_drvdata(dev);
struct cci_pmu *cci_pmu = to_cci_pmu(pmu);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(cci_pmu->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(cci_pmu->cpu)));
}
static struct device_attribute pmu_cpumask_attr =

drivers/perf/arm-ccn.c

View file
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
index c18a0e3..c40da34 100644
--- a/drivers/perf/arm-ccn.c
+++ b/drivers/perf/arm-ccn.c
@@ -537,7 +537,7 @@ static ssize_t arm_ccn_pmu_cpumask_show(struct device *dev,
{
struct arm_ccn *ccn = pmu_to_arm_ccn(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(ccn->dt.cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(ccn->dt.cpu)));
}
static struct device_attribute arm_ccn_pmu_cpumask_attr =

drivers/perf/arm-cmn.c

View file
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index a03e2a8..b162de3 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -1516,7 +1516,7 @@ static ssize_t arm_cmn_cpumask_show(struct device *dev,
{
struct arm_cmn *cmn = to_cmn(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(cmn->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(cmn->cpu)));
}
static struct device_attribute arm_cmn_cpumask_attr =

drivers/perf/arm-ni.c

View file
diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c
index 66858c6..03a1c6b 100644
--- a/drivers/perf/arm-ni.c
+++ b/drivers/perf/arm-ni.c
@@ -239,7 +239,7 @@ static ssize_t arm_ni_cpumask_show(struct device *dev,
{
struct arm_ni *ni = cd_to_ni(pmu_to_cd(dev_get_drvdata(dev)));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(ni->cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(ni->cpu)));
}
static struct device_attribute arm_ni_cpumask_attr =

drivers/perf/arm_cspmu/arm_cspmu.c

View file
diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
index 60005f8..912f03c 100644
--- a/drivers/perf/arm_cspmu/arm_cspmu.c
+++ b/drivers/perf/arm_cspmu/arm_cspmu.c
@@ -337,7 +337,7 @@ static ssize_t arm_cspmu_cpumask_show(struct device *dev,
default:
return 0;
}
- return cpumap_print_to_pagebuf(true, buf, cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask));
}
static struct attribute *arm_cspmu_cpumask_attrs[] = {

drivers/perf/arm_dmc620_pmu.c

View file
diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c
index 4f6b196..467147a 100644
--- a/drivers/perf/arm_dmc620_pmu.c
+++ b/drivers/perf/arm_dmc620_pmu.c
@@ -237,8 +237,8 @@ static ssize_t dmc620_pmu_cpumask_show(struct device *dev,
{
struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf,
- cpumask_of(dmc620_pmu->irq->cpu));
+ return sysfs_emit(buf, "%*pbl\n",
+ cpumask_pr_args(cpumask_of(dmc620_pmu->irq->cpu)));
}
static struct device_attribute dmc620_pmu_cpumask_attr =

drivers/perf/arm_dsu_pmu.c

View file
diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
index 32b0dd7..bcbd19e 100644
--- a/drivers/perf/arm_dsu_pmu.c
+++ b/drivers/perf/arm_dsu_pmu.c
@@ -157,7 +157,7 @@ static ssize_t dsu_pmu_cpumask_show(struct device *dev,
default:
return 0;
}
- return cpumap_print_to_pagebuf(true, buf, cpumask);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask));
}
static struct attribute *dsu_pmu_format_attrs[] = {

drivers/perf/arm_pmu.c

View file
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index aa1dac0..1150695 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -570,7 +570,7 @@ static ssize_t cpus_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct arm_pmu *armpmu = to_arm_pmu(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, &armpmu->supported_cpus);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&armpmu->supported_cpus));
}
static DEVICE_ATTR_RO(cpus);

drivers/perf/arm_smmuv3_pmu.c

View file
diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index 621f02a..8ce34e6 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -537,7 +537,7 @@ static ssize_t smmu_pmu_cpumask_show(struct device *dev,
{
struct smmu_pmu *smmu_pmu = to_smmu_pmu(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(smmu_pmu->on_cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(smmu_pmu->on_cpu)));
}
static struct device_attribute smmu_pmu_cpumask_attr =

drivers/perf/arm_spe_pmu.c

View file
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index b64cf23..b70f3fe 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -343,7 +343,7 @@ static ssize_t cpumask_show(struct device *dev,
{
struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev);
- return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus);
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&spe_pmu->supported_cpus));
}
static DEVICE_ATTR_RO(cpumask);

drivers/perf/cxl_pmu.c

View file
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index bb32cd1..2c8a03c 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -568,7 +568,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,
{
struct cxl_pmu_info *info = dev_get_drvdata(dev);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(info->on_cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(info->on_cpu)));
}
static DEVICE_ATTR_RO(cpumask);

drivers/perf/dwc_pcie_pmu.c

View file
diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c
index f5f3e5b..6b9ed59 100644
--- a/drivers/perf/dwc_pcie_pmu.c
+++ b/drivers/perf/dwc_pcie_pmu.c
@@ -121,7 +121,7 @@ static ssize_t cpumask_show(struct device *dev,
{
struct dwc_pcie_pmu *pcie_pmu = to_dwc_pcie_pmu(dev_get_drvdata(dev));
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(pcie_pmu->on_cpu));
+ return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpumask_of(pcie_pmu->on_cpu)));
}
static DEVICE_ATTR_RO(cpumask);

drivers/perf/fsl_imx8_ddr_perf.c

View file
diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c
index 6d1e99a..dd80462 100644
--- a/drivers/perf/fsl_imx8_ddr_perf.c
+++ b/drivers/perf/fsl_imx8_ddr_perf.c
@@ -237,7 +237,7 @@ static ssize_t ddr_perf_cpumask_show(struct device *dev,
{
struct ddr_pmu *pmu = dev_get_drvdata(dev);
- return cpumap_print_to_pagebuf(true, buf, cpumask_of(pmu->cpu));

This diff is incomplete. Download the complete patch.

drivers/perf/fsl_imx9_ddr_perf.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/fujitsu_uncore_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_pcie_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/hisilicon/hisi_uncore_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/marvell_cn10k_ddr_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/marvell_cn10k_tad_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/marvell_pem_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/nvidia_t410_c2c_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/nvidia_t410_cmem_latency_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/qcom_l2_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/qcom_l3_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/starfive_starlink_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/thunderx2_pmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/perf/xgene_pmu.c

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/bitops/le.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bitmap.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bits.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cpumask.h

View file

This diff is incomplete. Download the complete patch.

include/linux/nodemask.h

View file

This diff is incomplete. Download the complete patch.

kernel/events/core.c

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.debug

View file

This diff is incomplete. Download the complete patch.

lib/Makefile

View file

This diff is incomplete. Download the complete patch.

lib/bitmap-str.c

View file

This diff is incomplete. Download the complete patch.

lib/bitmap.c

View file

This diff is incomplete. Download the complete patch.

lib/find_bit_benchmark.c

View file

This diff is incomplete. Download the complete patch.

lib/region_alloc_benchmark.c

View file

This diff is incomplete. Download the complete patch.

lib/test_bitmap.c

View file

This diff is incomplete. Download the complete patch.

tools/include/linux/bits.h

View file

This diff is incomplete. Download the complete patch.