lib/cpumask: get rid of cpumap_print_to_pagebuf()
Subsystems (37)
cover lib/cpumask: get rid of cpumap_print_to_pagebuf()
cpumap_print_to_pagebuf() is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.
Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
(Apologize for the bulky CC list. Feel free to review only relevant patches.)
Yury Norov (16):
psci: simplify hotplug_tests()
arm: Use sysfs_emit() for cpumask show callbacks
powerpc: Use sysfs_emit() for cpumask show callbacks x86/events: Use sysfs_emit() for cpumask show callbacks
ACPI: pad: Use sysfs_emit() for idlecpus show
cpu: Use sysfs_emit() for cpumask show callback
devfreq: Use sysfs_emit() for cpumask show callbacks
fpga: dfl-fme-perf: Use sysfs_emit() for cpumask show
hwtracing: hisi_ptt: Use sysfs_emit() for cpumask show RDMA/hfi1: Use sysfs_emit() for cpumask show helper
nvdimm: Use sysfs_emit() for cpumask show callback PCI/sysfs: Use sysfs_emit() for cpumask show callbacks
perf: Use sysfs_emit() for cpumask show callbacks
powercap: intel_rapl: Use sysfs_emit() for cpumask show
thermal: intel: Use sysfs_emit() for powerclamp cpumask lib/bitmap-str: get rid of cpumap_print_to_pagebuf()
arch/arm/mach-imx/mmdc.c | 2 +- arch/arm/mm/cache-l2x0-pmu.c | 2 +- arch/powerpc/kernel/cacheinfo.c | 3 ++- arch/powerpc/perf/hv-24x7.c | 2 +- arch/powerpc/perf/hv-gpci.c | 2 +- arch/powerpc/perf/imc-pmu.c | 2 +- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/amd/power.c | 2 +- arch/x86/events/amd/uncore.c | 2 +- arch/x86/events/intel/core.c | 2 +- arch/x86/events/intel/uncore.c | 2 +- drivers/acpi/acpi_pad.c | 4 ++-- drivers/base/cpu.c | 2 +- drivers/devfreq/event/rockchip-dfi.c | 2 +- drivers/devfreq/hisi_uncore_freq.c | 2 +- drivers/firmware/psci/psci_checker.c | 14 ++------------ drivers/fpga/dfl-fme-perf.c | 2 +- drivers/hwtracing/ptt/hisi_ptt.c | 2 +- drivers/infiniband/hw/hfi1/sdma.c | 3 ++- drivers/nvdimm/nd_perf.c | 2 +- drivers/pci/pci-sysfs.c | 7 ++++--- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-ccn.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm-ni.c | 2 +- drivers/perf/arm_cspmu/arm_cspmu.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 4 ++-- drivers/perf/arm_dsu_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/cxl_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/fsl_imx8_ddr_perf.c | 2 +- drivers/perf/fsl_imx9_ddr_perf.c | 2 +- drivers/perf/fujitsu_uncore_pmu.c | 2 +- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- drivers/perf/marvell_pem_pmu.c | 2 +- drivers/perf/nvidia_t410_c2c_pmu.c | 2 +- drivers/perf/nvidia_t410_cmem_latency_pmu.c | 2 +- drivers/perf/qcom_l2_pmu.c | 2 +- drivers/perf/qcom_l3_pmu.c | 2 +- drivers/perf/starfive_starlink_pmu.c | 2 +- drivers/perf/thunderx2_pmu.c | 2 +- drivers/perf/xgene_pmu.c | 2 +- drivers/powercap/intel_rapl_common.c | 2 +- drivers/thermal/intel/intel_powerclamp.c | 2 +- include/linux/cpumask.h | 19 ------------------- kernel/events/core.c | 2 +- lib/bitmap-str.c | 9 ++++----- 55 files changed, 65 insertions(+), 92 deletions(-)
Signature · 1 line
2.51.0
PATCH 1/16 psci: simplify hotplug_tests()
Switch to pr_info("... %pbl"), and drop the temporary buffer allocation.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/firmware/psci/psci_checker.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/firmware/psci/psci_checker.c +2 -12
@@ -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,16 +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:
Signature · 1 line
2.51.0
Re: [PATCH 01/16] psci: simplify hotplug_tests()
Quoted 1 line · Yury Norov
Switch to pr_info("... %pbl"), and drop the temporary buffer allocation.
I would say this is simply an improvement in its own right, regardless of whether cpumap_print_to_pagebuf() deserves to be removed or not. For the change itself, FWIW,
Quoted 49 lines
This prepares for removing
cpumap_print_to_pagebuf().Signed-off-by Yury Norov <[email protected]>--- drivers/firmware/psci/psci_checker.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)drivers/firmware/psci/psci_checker.c +2
-12@@ -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,16 +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:
PATCH 2/16 arm: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- arch/arm/mach-imx/mmdc.c | 2 +- arch/arm/mm/cache-l2x0-pmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-imx/mmdc.c +1 -1
@@ -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 +1 -1
@@ -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 =
Signature · 1 line
2.51.0
PATCH 3/16 powerpc: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- arch/powerpc/kernel/cacheinfo.c | 3 ++- arch/powerpc/perf/hv-24x7.c | 2 +- arch/powerpc/perf/hv-gpci.c | 2 +- arch/powerpc/perf/imc-pmu.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
arch/powerpc/kernel/cacheinfo.c +2 -1
@@ -689,7 +689,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 +1 -1
@@ -428,7 +428,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 +1 -1
@@ -99,7 +99,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 +1 -1
@@ -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);
Signature · 1 line
2.51.0
PATCH 4/16 x86/events: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- arch/x86/events/amd/iommu.c | 2 +- arch/x86/events/amd/power.c | 2 +- arch/x86/events/amd/uncore.c | 2 +- arch/x86/events/intel/core.c | 2 +- arch/x86/events/intel/uncore.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/x86/events/amd/iommu.c +1 -1
@@ -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 +1 -1
@@ -147,7 +147,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 +1 -1
@@ -321,7 +321,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 +1 -1
@@ -7311,7 +7311,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 +1 -1
@@ -842,7 +842,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);
Signature · 1 line
2.51.0
PATCH 5/16 ACPI: pad: Use sysfs_emit() for idlecpus show
In reply to Yury Norovidlecpus_show() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/acpi/acpi_pad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpi_pad.c +2 -2
@@ -334,8 +334,8 @@ static ssize_t idlecpus_store(struct device *dev,static ssize_t idlecpus_show (struct device *dev,struct device_attribute *attr,char *buf) { -return cpumap_print_to_pagebuf (false, buf, -to_cpumask (pad_busy_cpus_bits)); +return sysfs_emit (buf,"%*pb\n" , +cpumask_pr_args (to_cpumask (pad_busy_cpus_bits))); }static DEVICE_ATTR_RW (idlecpus);
Signature · 1 line
2.51.0
Rafael J. Wysocki
maintainerRe: [PATCH 05/16] ACPI: pad: Use sysfs_emit() for idlecpus show
Quoted 17 lines · Yury Norov
idlecpus_show()is a sysfs show callback. Usesysfs_emit()andcpumask_pr_args()to emit the mask.This prepares for removing
cpumap_print_to_pagebuf().Signed-off-by Yury Norov <[email protected]>--- drivers/acpi/acpi_pad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/acpi/acpi_pad.c +0
-0@@ -334,8 +334,8 @@ static ssize_t idlecpus_store(struct device *dev, static ssize_t idlecpus_show(struct device *dev,
drivers/acpi/acpi_pad.c static ssize_t idlecpus_store(struct device *dev,
Quoted 10 lines
drivers/acpi/acpi_pad.c +2
-3struct device_attribute *attr, char *buf) { - return cpumap_print_to_pagebuf(false, buf, -to_cpumask (pad_busy_cpus_bits )); + return sysfs_emit(buf, "%*pb\n", +cpumask_pr_args (to_cpumask (pad_busy_cpus_bits ))); }static DEVICE_ATTR_RW (idlecpus); --
Applied (with a tweaked subject) as 7.2 material, thanks!
PATCH 6/16 cpu: Use sysfs_emit() for cpumask show callback
In reply to Yury Norovshow_cpus_attr() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/base/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/cpu.c +1 -1
@@ -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) \
Signature · 1 line
2.51.0
PATCH 7/16 devfreq: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths. Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/devfreq/event/rockchip-dfi.c | 2 +- drivers/devfreq/hisi_uncore_freq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/devfreq/event/rockchip-dfi.c +1 -1
@@ -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 +1 -1
@@ -541,7 +541,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);
Signature · 1 line
2.51.0
PATCH 8/16 fpga: dfl-fme-perf: Use sysfs_emit() for cpumask show
In reply to Yury Norovcpumask_show() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/fpga/dfl-fme-perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl-fme-perf.c +1 -1
@@ -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);
Signature · 1 line
2.51.0
PATCH 9/16 hwtracing: hisi_ptt: Use sysfs_emit() for cpumask show
In reply to Yury Norovcpumask_show() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/hwtracing/ptt/hisi_ptt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/ptt/hisi_ptt.c +1 -1
@@ -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);
Signature · 1 line
2.51.0
PATCH 10/16 RDMA/hfi1: Use sysfs_emit() for cpumask show helper
In reply to Yury Norovsdma_get_cpu_to_sde_map() is used by a sysfs show callback.
Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/infiniband/hw/hfi1/sdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/sdma.c +2 -1
@@ -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 ); }
Signature · 1 line
2.51.0
PATCH 11/16 nvdimm: Use sysfs_emit() for cpumask show callback
In reply to Yury Norovnvdimm_pmu_cpumask_show() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/nvdimm/nd_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvdimm/nd_perf.c +1 -1
@@ -123,7 +123,7 @@ static ssize_t nvdimm_pmu_cpumask_show(struct device *dev, nd_pmu = container_of(pmu, struct nvdimm_pmu, pmu); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (nd_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (nd_pmu->cpu))); }static int nvdimm_pmu_cpu_offline (unsigned int cpu,struct hlist_node *node)
Signature · 1 line
2.51.0
Alison Schofield
maintainerRe: [PATCH 11/16] nvdimm: Use sysfs_emit() for cpumask show callback
Quoted 6 lines · Yury Norov
nvdimm_pmu_cpumask_show()is a sysfs show callback. Usesysfs_emit()andcpumask_pr_args()to emit the mask.This prepares for removing
cpumap_print_to_pagebuf().Signed-off-by Yury Norov <[email protected]>
Thanks! Reviewed and applied to nvdimm/nvdimm.git (libnvdimm-for-next)
https://git.kernel.org/nvdimm/nvdimm/c/1e7afc906f2f
Quoted 1 line
PATCH 12/16 PCI/sysfs: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/pci/pci-sysfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/pci/pci-sysfs.c +4 -3
@@ -114,7 +114,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,
@@ -139,7 +140,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);
@@ -148,7 +149,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);
Signature · 1 line
2.51.0
PATCH 13/16 perf: Use sysfs_emit() for cpumask show callbacks
In reply to Yury NorovThese callbacks are sysfs show paths.
Use sysfs_emit() and cpumask_pr_args() to emit the masks.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-ccn.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm-ni.c | 2 +- drivers/perf/arm_cspmu/arm_cspmu.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 4 ++-- drivers/perf/arm_dsu_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/cxl_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/fsl_imx8_ddr_perf.c | 2 +- drivers/perf/fsl_imx9_ddr_perf.c | 2 +- drivers/perf/fujitsu_uncore_pmu.c | 2 +- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- drivers/perf/marvell_pem_pmu.c | 2 +- drivers/perf/nvidia_t410_c2c_pmu.c | 2 +- drivers/perf/nvidia_t410_cmem_latency_pmu.c | 2 +- drivers/perf/qcom_l2_pmu.c | 2 +- drivers/perf/qcom_l3_pmu.c | 2 +- drivers/perf/starfive_starlink_pmu.c | 2 +- drivers/perf/thunderx2_pmu.c | 2 +- drivers/perf/xgene_pmu.c | 2 +- kernel/events/core.c | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-)
drivers/perf/alibaba_uncore_drw_pmu.c +1 -1
@@ -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 +1 -1
@@ -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 +1 -1
@@ -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 +1 -1
@@ -538,7 +538,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 +1 -1
@@ -1326,7 +1326,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 +1 -1
@@ -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 +1 -1
@@ -305,7 +305,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 +2 -2
@@ -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 +1 -1
@@ -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 +1 -1
@@ -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 +1 -1
@@ -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 +1 -1
@@ -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 +1 -1
@@ -493,7 +493,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 +1 -1
@@ -117,7 +117,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 +1 -1
@@ -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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =
drivers/perf/fsl_imx9_ddr_perf.c +1 -1
@@ -159,7 +159,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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =
drivers/perf/fujitsu_uncore_pmu.c +1 -1
@@ -374,7 +374,7 @@ static ssize_t cpumask_show(struct device *dev, {struct uncore_pmu *uncorepmu =to_uncore_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (uncorepmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (uncorepmu->cpu))); }static DEVICE_ATTR_RO (cpumask);
drivers/perf/hisilicon/hisi_pcie_pmu.c +1 -1
@@ -121,7 +121,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, c {struct hisi_pcie_pmu *pcie_pmu =to_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/hisilicon/hisi_uncore_pmu.c +1 -1
@@ -56,7 +56,7 @@ static ssize_t hisi_associated_cpus_sysfs_show(struct device *dev, {struct hisi_pmu *hisi_pmu =to_hisi_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &hisi_pmu->associated_cpus); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&hisi_pmu->associated_cpus)); } static DEVICE_ATTR(associated_cpus, 0444, hisi_associated_cpus_sysfs_show, NULL);
drivers/perf/marvell_cn10k_ddr_pmu.c +1 -1
@@ -364,7 +364,7 @@ static ssize_t cn10k_ddr_perf_cpumask_show(struct device *dev, {struct cn10k_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 cn10k_ddr_perf_cpumask_attr =
drivers/perf/marvell_cn10k_tad_pmu.c +1 -1
@@ -258,7 +258,7 @@ static ssize_t tad_pmu_cpumask_show(struct device *dev, {struct tad_pmu *tad_pmu =to_tad_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tad_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tad_pmu->cpu))); } static DEVICE_ATTR(cpumask, 0444, tad_pmu_cpumask_show, NULL);
drivers/perf/marvell_pem_pmu.c +1 -1
@@ -164,7 +164,7 @@ static ssize_t pem_perf_cpumask_show(struct device *dev, {struct pem_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 pem_perf_cpumask_attr =
drivers/perf/nvidia_t410_c2c_pmu.c +1 -1
@@ -658,7 +658,7 @@ static ssize_t nv_c2c_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)); }#define NV_C2C_PMU_CPUMASK_ATTR (_name, _config) \
drivers/perf/nvidia_t410_cmem_latency_pmu.c +1 -1
@@ -501,7 +501,7 @@ static ssize_t cmem_lat_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)); }#define NV_PMU_CPUMASK_ATTR (_name, _config) \
drivers/perf/qcom_l2_pmu.c +1 -1
@@ -638,7 +638,7 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev, {struct l2cache_pmu *l2cache_pmu =to_l2cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l2cache_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l2cache_pmu->cpumask)); } static struct device_attribute l2_cache_pmu_cpumask_attr =
drivers/perf/qcom_l3_pmu.c +1 -1
@@ -663,7 +663,7 @@ static ssize_t cpumask_show(struct device *dev, {struct l3cache_pmu *l3pmu =to_l3cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l3pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l3pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);
drivers/perf/starfive_starlink_pmu.c +1 -1
@@ -131,7 +131,7 @@ cpumask_show(struct device *dev, struct device_attribute *attr, char *buf) {struct starlink_pmu *starlink_pmu =to_starlink_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &starlink_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&starlink_pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);
drivers/perf/thunderx2_pmu.c +1 -1
@@ -254,7 +254,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct tx2_uncore_pmu *tx2_pmu; tx2_pmu =pmu_to_tx2_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tx2_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tx2_pmu->cpu))); }static DEVICE_ATTR_RO (cpumask);
drivers/perf/xgene_pmu.c +1 -1
@@ -595,7 +595,7 @@ static ssize_t cpumask_show(struct device *dev, {struct xgene_pmu_dev *pmu_dev =to_pmu_dev (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &pmu_dev->parent->cpu); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&pmu_dev->parent->cpu)); }static DEVICE_ATTR_RO (cpumask);
kernel/events/core.c +1 -1
@@ -12657,7 +12657,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct cpumask *mask =perf_scope_cpumask (pmu->scope);if (mask) -return cpumap_print_to_pagebuf (true, buf, mask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (mask));return 0 ; }
Signature · 1 line
2.51.0
Robin Murphy
maintainerRe: [PATCH 13/16] perf: Use sysfs_emit() for cpumask show callbacks
Quoted 5 lines · Yury Norov
These callbacks are sysfs show paths.
Use
sysfs_emit()andcpumask_pr_args()to emit the masks.This prepares for removing
cpumap_print_to_pagebuf().
TBH, looking at this diff I think it only shows the value of having a helper to abstract the boilerplate...
I'm not sure I agree with the argument of removing something entirely just because it may occasionally be misused, but could we at least have something like:
#define sysfs_emit_cpumask(buf, mask) \ sysfs_emit((buf), "%*pbl\n", cpumask_pr_args(mask))
to save the mess in all the many places where the current cpumap_print_to_pagebuf() usage _is_ entirely appropriate?
Thansk,
Robin.
Quoted 426 lines
Signed-off-by Yury Norov <[email protected]>--- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-ccn.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm-ni.c | 2 +- drivers/perf/arm_cspmu/arm_cspmu.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 4 ++-- drivers/perf/arm_dsu_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/cxl_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/fsl_imx8_ddr_perf.c | 2 +- drivers/perf/fsl_imx9_ddr_perf.c | 2 +- drivers/perf/fujitsu_uncore_pmu.c | 2 +- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- drivers/perf/marvell_pem_pmu.c | 2 +- drivers/perf/nvidia_t410_c2c_pmu.c | 2 +- drivers/perf/nvidia_t410_cmem_latency_pmu.c | 2 +- drivers/perf/qcom_l2_pmu.c | 2 +- drivers/perf/qcom_l3_pmu.c | 2 +- drivers/perf/starfive_starlink_pmu.c | 2 +- drivers/perf/thunderx2_pmu.c | 2 +- drivers/perf/xgene_pmu.c | 2 +- kernel/events/core.c | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-)drivers/perf/alibaba_uncore_drw_pmu.c +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -538,7 +538,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 +1
-1@@ -1326,7 +1326,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 +1
-1@@ -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 +1
-1@@ -305,7 +305,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 +2
-2@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -493,7 +493,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 +1
-1@@ -117,7 +117,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 +1
-1@@ -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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =drivers/perf/fsl_imx9_ddr_perf.c +1
-1@@ -159,7 +159,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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =drivers/perf/fujitsu_uncore_pmu.c +1
-1@@ -374,7 +374,7 @@ static ssize_t cpumask_show(struct device *dev, {struct uncore_pmu *uncorepmu =to_uncore_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (uncorepmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (uncorepmu->cpu))); }static DEVICE_ATTR_RO (cpumask);drivers/perf/hisilicon/hisi_pcie_pmu.c +1
-1@@ -121,7 +121,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, c {struct hisi_pcie_pmu *pcie_pmu =to_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/hisilicon/hisi_uncore_pmu.c +1
-1@@ -56,7 +56,7 @@ static ssize_t hisi_associated_cpus_sysfs_show(struct device *dev, {struct hisi_pmu *hisi_pmu =to_hisi_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &hisi_pmu->associated_cpus); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&hisi_pmu->associated_cpus)); } static DEVICE_ATTR(associated_cpus, 0444, hisi_associated_cpus_sysfs_show, NULL);drivers/perf/marvell_cn10k_ddr_pmu.c +1
-1@@ -364,7 +364,7 @@ static ssize_t cn10k_ddr_perf_cpumask_show(struct device *dev, {struct cn10k_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 cn10k_ddr_perf_cpumask_attr =drivers/perf/marvell_cn10k_tad_pmu.c +1
-1@@ -258,7 +258,7 @@ static ssize_t tad_pmu_cpumask_show(struct device *dev, {struct tad_pmu *tad_pmu =to_tad_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tad_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tad_pmu->cpu))); } static DEVICE_ATTR(cpumask, 0444, tad_pmu_cpumask_show, NULL);drivers/perf/marvell_pem_pmu.c +1
-1@@ -164,7 +164,7 @@ static ssize_t pem_perf_cpumask_show(struct device *dev, {struct pem_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 pem_perf_cpumask_attr =drivers/perf/nvidia_t410_c2c_pmu.c +1
-1@@ -658,7 +658,7 @@ static ssize_t nv_c2c_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)); }#define NV_C2C_PMU_CPUMASK_ATTR (_name, _config) \drivers/perf/nvidia_t410_cmem_latency_pmu.c +1
-1@@ -501,7 +501,7 @@ static ssize_t cmem_lat_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)); }#define NV_PMU_CPUMASK_ATTR (_name, _config) \drivers/perf/qcom_l2_pmu.c +1
-1@@ -638,7 +638,7 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev, {struct l2cache_pmu *l2cache_pmu =to_l2cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l2cache_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l2cache_pmu->cpumask)); } static struct device_attribute l2_cache_pmu_cpumask_attr =drivers/perf/qcom_l3_pmu.c +1
-1@@ -663,7 +663,7 @@ static ssize_t cpumask_show(struct device *dev, {struct l3cache_pmu *l3pmu =to_l3cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l3pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l3pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);drivers/perf/starfive_starlink_pmu.c +1
-1@@ -131,7 +131,7 @@ cpumask_show(struct device *dev, struct device_attribute *attr, char *buf) {struct starlink_pmu *starlink_pmu =to_starlink_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &starlink_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&starlink_pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);drivers/perf/thunderx2_pmu.c +1
-1@@ -254,7 +254,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct tx2_uncore_pmu *tx2_pmu; tx2_pmu =pmu_to_tx2_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tx2_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tx2_pmu->cpu))); }static DEVICE_ATTR_RO (cpumask);drivers/perf/xgene_pmu.c +1
-1@@ -595,7 +595,7 @@ static ssize_t cpumask_show(struct device *dev, {struct xgene_pmu_dev *pmu_dev =to_pmu_dev (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &pmu_dev->parent->cpu); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&pmu_dev->parent->cpu)); }static DEVICE_ATTR_RO (cpumask);kernel/events/core.c +1
-1@@ -12657,7 +12657,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct cpumask *mask =perf_scope_cpumask (pmu->scope);if (mask) -return cpumap_print_to_pagebuf (true, buf, mask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (mask));return 0 ; }
Re: [PATCH 13/16] perf: Use sysfs_emit() for cpumask show callbacks
Quoted 14 lines · On Fri, 29 May 2026 12:05:08 +0100 Robin Murphy <[email protected]> wrote:
Quoted 5 lines · Yury Norov
These callbacks are sysfs show paths.
Use
sysfs_emit()andcpumask_pr_args()to emit the masks.This prepares for removing
cpumap_print_to_pagebuf().TBH, looking at this diff I think it only shows the value of having a helper to abstract the boilerplate...
I'm not sure I agree with the argument of removing something entirely just because it may occasionally be misused, but could we at least have something like:
Quoted 5 lines
#define sysfs_emit_cpumask(buf, mask) \ sysfs_emit((buf), "%*pbl\n", cpumask_pr_args(mask))to save the mess in all the many places where the current
cpumap_print_to_pagebuf()usage _is_ entirely appropriate?
That has the advantage of letting you change how it is done (again) without having to find all the callers.
-- David
Quoted 432 lines
Thansk,
Robin.Quoted 426 lines
Signed-off-by Yury Norov <[email protected]>--- drivers/perf/alibaba_uncore_drw_pmu.c | 2 +- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-ccn.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm-ni.c | 2 +- drivers/perf/arm_cspmu/arm_cspmu.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 4 ++-- drivers/perf/arm_dsu_pmu.c | 2 +- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 2 +- drivers/perf/arm_spe_pmu.c | 2 +- drivers/perf/cxl_pmu.c | 2 +- drivers/perf/dwc_pcie_pmu.c | 2 +- drivers/perf/fsl_imx8_ddr_perf.c | 2 +- drivers/perf/fsl_imx9_ddr_perf.c | 2 +- drivers/perf/fujitsu_uncore_pmu.c | 2 +- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- drivers/perf/marvell_pem_pmu.c | 2 +- drivers/perf/nvidia_t410_c2c_pmu.c | 2 +- drivers/perf/nvidia_t410_cmem_latency_pmu.c | 2 +- drivers/perf/qcom_l2_pmu.c | 2 +- drivers/perf/qcom_l3_pmu.c | 2 +- drivers/perf/starfive_starlink_pmu.c | 2 +- drivers/perf/thunderx2_pmu.c | 2 +- drivers/perf/xgene_pmu.c | 2 +- kernel/events/core.c | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-)drivers/perf/alibaba_uncore_drw_pmu.c +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -538,7 +538,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 +1
-1@@ -1326,7 +1326,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 +1
-1@@ -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 +1
-1@@ -305,7 +305,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 +2
-2@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -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 +1
-1@@ -493,7 +493,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 +1
-1@@ -117,7 +117,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 +1
-1@@ -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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =drivers/perf/fsl_imx9_ddr_perf.c +1
-1@@ -159,7 +159,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)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (pmu->cpu))); } static struct device_attribute ddr_perf_cpumask_attr =drivers/perf/fujitsu_uncore_pmu.c +1
-1@@ -374,7 +374,7 @@ static ssize_t cpumask_show(struct device *dev, {struct uncore_pmu *uncorepmu =to_uncore_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (uncorepmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (uncorepmu->cpu))); }static DEVICE_ATTR_RO (cpumask);drivers/perf/hisilicon/hisi_pcie_pmu.c +1
-1@@ -121,7 +121,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, c {struct hisi_pcie_pmu *pcie_pmu =to_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/hisilicon/hisi_uncore_pmu.c +1
-1@@ -56,7 +56,7 @@ static ssize_t hisi_associated_cpus_sysfs_show(struct device *dev, {struct hisi_pmu *hisi_pmu =to_hisi_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &hisi_pmu->associated_cpus); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&hisi_pmu->associated_cpus)); } static DEVICE_ATTR(associated_cpus, 0444, hisi_associated_cpus_sysfs_show, NULL);drivers/perf/marvell_cn10k_ddr_pmu.c +1
-1@@ -364,7 +364,7 @@ static ssize_t cn10k_ddr_perf_cpumask_show(struct device *dev, {struct cn10k_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 cn10k_ddr_perf_cpumask_attr =drivers/perf/marvell_cn10k_tad_pmu.c +1
-1@@ -258,7 +258,7 @@ static ssize_t tad_pmu_cpumask_show(struct device *dev, {struct tad_pmu *tad_pmu =to_tad_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tad_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tad_pmu->cpu))); } static DEVICE_ATTR(cpumask, 0444, tad_pmu_cpumask_show, NULL);drivers/perf/marvell_pem_pmu.c +1
-1@@ -164,7 +164,7 @@ static ssize_t pem_perf_cpumask_show(struct device *dev, {struct pem_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 pem_perf_cpumask_attr =drivers/perf/nvidia_t410_c2c_pmu.c +1
-1@@ -658,7 +658,7 @@ static ssize_t nv_c2c_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)); }#define NV_C2C_PMU_CPUMASK_ATTR (_name, _config) \drivers/perf/nvidia_t410_cmem_latency_pmu.c +1
-1@@ -501,7 +501,7 @@ static ssize_t cmem_lat_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)); }#define NV_PMU_CPUMASK_ATTR (_name, _config) \drivers/perf/qcom_l2_pmu.c +1
-1@@ -638,7 +638,7 @@ static ssize_t l2_cache_pmu_cpumask_show(struct device *dev, {struct l2cache_pmu *l2cache_pmu =to_l2cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l2cache_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l2cache_pmu->cpumask)); } static struct device_attribute l2_cache_pmu_cpumask_attr =drivers/perf/qcom_l3_pmu.c +1
-1@@ -663,7 +663,7 @@ static ssize_t cpumask_show(struct device *dev, {struct l3cache_pmu *l3pmu =to_l3cache_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &l3pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&l3pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);drivers/perf/starfive_starlink_pmu.c +1
-1@@ -131,7 +131,7 @@ cpumask_show(struct device *dev, struct device_attribute *attr, char *buf) {struct starlink_pmu *starlink_pmu =to_starlink_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &starlink_pmu->cpumask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&starlink_pmu->cpumask)); }static DEVICE_ATTR_RO (cpumask);drivers/perf/thunderx2_pmu.c +1
-1@@ -254,7 +254,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct tx2_uncore_pmu *tx2_pmu; tx2_pmu =pmu_to_tx2_pmu (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf,cpumask_of (tx2_pmu->cpu)); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpumask_of (tx2_pmu->cpu))); }static DEVICE_ATTR_RO (cpumask);drivers/perf/xgene_pmu.c +1
-1@@ -595,7 +595,7 @@ static ssize_t cpumask_show(struct device *dev, {struct xgene_pmu_dev *pmu_dev =to_pmu_dev (dev_get_drvdata (dev)); -return cpumap_print_to_pagebuf (true, buf, &pmu_dev->parent->cpu); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (&pmu_dev->parent->cpu)); }static DEVICE_ATTR_RO (cpumask);kernel/events/core.c +1
-1@@ -12657,7 +12657,7 @@ static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,struct cpumask *mask =perf_scope_cpumask (pmu->scope);if (mask) -return cpumap_print_to_pagebuf (true, buf, mask); +return sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (mask));return 0 ; }
Yury Norov
maintainerRe: [PATCH 13/16] perf: Use sysfs_emit() for cpumask show callbacks
Quoted 17 lines · David Laight
Quoted 14 lines · On Fri, 29 May 2026 12:05:08 +0100 Robin Murphy <[email protected]> wrote:
Quoted 5 lines · Yury Norov
These callbacks are sysfs show paths.
Use
sysfs_emit()andcpumask_pr_args()to emit the masks.This prepares for removing
cpumap_print_to_pagebuf().TBH, looking at this diff I think it only shows the value of having a helper to abstract the boilerplate...
I'm not sure I agree with the argument of removing something entirely just because it may occasionally be misused, but could we at least have something like:
Quoted 5 lines
Quoted 5 lines
#define sysfs_emit_cpumask(buf, mask) \ sysfs_emit((buf), "%*pbl\n", cpumask_pr_args(mask))to save the mess in all the many places where the current
cpumap_print_to_pagebuf()usage _is_ entirely appropriate?
This way you have to add 2 wrappers:
#define sysfs_emit_cpulist(buf, mask) \
sysfs_emit((buf), "%*pbl\n", cpumask_pr_args(mask))
and
#define sysfs_emit_cpumask(buf, mask) \
sysfs_emit((buf), "%*pb\n", cpumask_pr_args(mask))
There are people who complain even about DIV_ROUND_UP(), how hard it is to keep all that helpers in memory, and all that things.
https://lore.kernel.org/all/[email protected]/
Disagree about DIV_ROUND_UP() (because yeah, I'm bad in math), but this sysfs_emit_cpumask() is a complete syntax redundancy.
Once we have it, people will do this type of things:
tmp = kmalloc(PAGE_SIZE);
sysfs_emit_cpumask(tmp, mask);
sysfs_emit(buf, "my prefix: %s\n", tmp);
kfree(tmp);Patch #1 in this series is one example. My series that removes bitmap_print_to_pagebuf() will give you more:
https://lore.kernel.org/all/[email protected]/
It doesn't mean that *you* will misuse the API. It means that *I* will have to inspect the codebase for that type of bugs periodically.
So, the overall state is simple: we've got well-established printf()-like functions that people know and understand, and we also have exotic APIs here and there with a non-standard interface and a clear potential to misuse. In this case, they have historical roots, but now we don't need them.
Quoted 2 lines
That has the advantage of letting you change how it is done (again) without having to find all the callers.
You mean things like silencing the prints or adding a prefix?
If you believe that perf subsystem would benefit from it - that's OK. Just please keep it local. The kernel globally doesn't need to 'change how it is done' beyond the lib/vsprintf. The kernel really needs people to use something that the other people are familiar with.
Thanks,
Yury
PATCH 14/16 powercap: intel_rapl: Use sysfs_emit() for cpumask show
In reply to Yury Norovcpumask_show() is a sysfs show callback. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/powercap/intel_rapl_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/powercap/intel_rapl_common.c +1 -1
@@ -1441,7 +1441,7 @@ static ssize_t cpumask_show(struct device *dev, }cpus_read_unlock (); - ret =cpumap_print_to_pagebuf (true, buf, cpu_mask); + ret =sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpu_mask));free_cpumask_var (cpu_mask);
Signature · 1 line
2.51.0
Rafael J. Wysocki
maintainerRe: [PATCH 14/16] powercap: intel_rapl: Use sysfs_emit() for cpumask show
Quoted 16 lines · Yury Norov
cpumask_show()is a sysfs show callback. Usesysfs_emit()andcpumask_pr_args()to emit the mask.This prepares for removing
cpumap_print_to_pagebuf().Signed-off-by Yury Norov <[email protected]>--- drivers/powercap/intel_rapl_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/powercap/intel_rapl_common.c +0
-0
drivers/powercap/intel_rapl_common.c static ssize_t cpumask_show(struct device *dev,
Quoted 9 lines
drivers/powercap/intel_rapl_common.c +1
-2@@ -1441,7 +1441,7 @@ static ssize_t cpumask_show(struct device *dev, }cpus_read_unlock (); - ret =cpumap_print_to_pagebuf (true, buf, cpu_mask); + ret =sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (cpu_mask));free_cpumask_var (cpu_mask); --
Applied (with adjusted subject and changelog) as 7.2 material, thanks!
PATCH 15/16 thermal: intel: Use sysfs_emit() for powerclamp cpumask
In reply to Yury Norovcpumask_get() is used as a sysfs getter for the cpumask module parameter. Use sysfs_emit() and cpumask_pr_args() to emit the mask.
This prepares for removing cpumap_print_to_pagebuf().
--- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_powerclamp.c +1 -1
@@ -200,7 +200,7 @@ static int cpumask_get(char *buf, const struct kernel_param *kp)if (!cpumask_available (idle_injection_cpu_mask))return -ENODEV ; -return cpumap_print_to_pagebuf (false, buf, idle_injection_cpu_mask); +return sysfs_emit (buf,"%*pb\n" ,cpumask_pr_args (idle_injection_cpu_mask)); }static const struct kernel_param_ops cpumask_ops = {
Signature · 1 line
2.51.0
Re: [PATCH 15/16] thermal: intel: Use sysfs_emit() for powerclamp cpumask
Quoted 16 lines · Yury Norov
cpumask_get()is used as a sysfs getter for the cpumask module parameter. Usesysfs_emit()andcpumask_pr_args()to emit the mask.This prepares for removing
cpumap_print_to_pagebuf().Signed-off-by Yury Norov <[email protected]>--- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/intel/intel_powerclamp.c +0
-0
drivers/thermal/intel/intel_powerclamp.c static int cpumask_get(char *buf, const struct kernel_param *kp)
Quoted 9 lines
drivers/thermal/intel/intel_powerclamp.c +1
-2@@ -200,7 +200,7 @@ static int cpumask_get(char *buf, const struct kernel_param *kp)if (!cpumask_available (idle_injection_cpu_mask))return -ENODEV ; -return cpumap_print_to_pagebuf (false, buf, idle_injection_cpu_mask); +return sysfs_emit (buf,"%*pb\n" ,cpumask_pr_args (idle_injection_cpu_mask)); }static const struct kernel_param_ops cpumask_ops = { --
Applied as 7.2 material, thanks!
PATCH 16/16 lib/bitmap-str: get rid of cpumap_print_to_pagebuf()
In reply to Yury NorovNow that all users of the function are switched to the alternatives, drop the function.
--- include/linux/cpumask.h | 19 ------------------- lib/bitmap-str.c | 9 ++++----- 2 files changed, 4 insertions(+), 24 deletions(-)
include/linux/cpumask.h +0 -19
@@ -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>
@@ -1315,24 +1314,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
lib/bitmap-str.c +4 -5
@@ -75,8 +75,7 @@ static int bitmap_print_to_buf(bool list, char *buf, const unsigned long *maskp,* @off: in the string from which we are copying, We copy to @buf * @count: the maximum number of bytes to print * -* The sprintf("%*pb[l]") is used indirectly via its cpumap wrapper -* cpumap_print_to_pagebuf() or directly by drivers to export hexadecimal +* The sprintf("%*pb[l]") format is used by drivers to export hexadecimal * bitmask and decimal list to userspace by sysfs ABI. * Drivers might be using a normal attribute for this kind of ABIs. A * normal attribute typically has show entry as below::
@@ -115,9 +114,9 @@ static int bitmap_print_to_buf(bool list, char *buf, const unsigned long *maskp,* parameters such as off, count from bin_attribute show entry to this API. * * The role of cpumap_print_bitmask_to_buf() and cpumap_print_list_to_buf() -* is similar with cpumap_print_to_pagebuf(), the difference is that -* scnprintf("%*pb[l]") mainly serves sysfs attribute with the assumption -* the destination buffer is exactly one page and won't be more than one page. +* is similar to direct sysfs_emit("%*pb[l]") formatting, but the latter +* assumes the destination buffer is exactly one page and won't be more than +* one page. * cpumap_print_bitmask_to_buf() and cpumap_print_list_to_buf(), on the other * hand, mainly serves bin_attribute which doesn't work with exact one page, * and it can break the size limit of converted decimal list and hexadecimal
Signature · 1 line
2.51.0
Andrew Morton
maintainerQuoted 11 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]
Quoted 8 lines · Andrew Morton
Quoted 6 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Quoted 8 lines
Quoted 5 lines
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]
OK... What should I do about that?
Andrew Morton
maintainerQuoted 13 lines · On Thu, 28 May 2026 15:26:28 -0400 Yury Norov <[email protected]> wrote:
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
On top of bitmap-for-next.
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]OK... What should I do about that?
Rebase onto something which Sashiko *does* attempt. Mainline, a few mm.git branches. Maybe linux-next.
Roman, is there a list of trees/branches which Sashiko tries to apply series to?
Thanks.
Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Thu, 28 May 2026 15:26:28 -0400 Yury Norov <[email protected]> wrote:
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]OK... What should I do about that?
Rebase onto something which Sashiko *does* attempt. Mainline, a few mm.git branches. Maybe linux-next.
Is Sashiko a new mandatory requirement now? Documentation doesn't even mention the bot.
Quoted 2 lines
Roman, is there a list of trees/branches which Sashiko tries to apply series to?
Hi Roman,
Can you add bitmap-for-next in the list?
Thanks,
Yury
Ian Rogers
reviewerQuoted 30 lines · Yury Norov
Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Thu, 28 May 2026 15:26:28 -0400 Yury Norov <[email protected]> wrote:
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]OK... What should I do about that?
Rebase onto something which Sashiko *does* attempt. Mainline, a few mm.git branches. Maybe linux-next.
Is Sashiko a new mandatory requirement now? Documentation doesn't even mention the bot.
Quoted 6 lines
Quoted 2 lines
Roman, is there a list of trees/branches which Sashiko tries to apply series to?
Hi Roman,
Can you add bitmap-for-next in the list?
Fwiw, you can see the list of branches attempted and the SHA they are at in the Baseline drop down:
Baseline Status Log
tip/x86/core (0f61b1860cc3f52aef9036d7235ed1f017632193) Failed View Log powerpc/HEAD (6916d5703ddf9a38f1f6c2cc793381a24ee914c6) Failed View Log chanwoo/HEAD (7fd2df204f342fc17d1a0bfcd474b24232fb0f32) Failed View Log linux-arm/HEAD (dd6c438c3e64a5ff0b5d7e78f7f9be547803ef1b) Failed View Log linux-pm/HEAD (e7ae89a0c97ce2b68b0983cd01eda67cf373517d) Failed View Log linux-fpga/HEAD Failed View Log
pci/HEAD (254f49634ee16a731174d2ae34bc50bd5f45e731) Failed View Log linux-pm/thermal (21c315342b81526874acfa311f11b3f72bed4e14) Failed View Log rdma/HEAD (67464f388d52ec172be62c99fc43697437ffa384) Failed View Log linux-next/HEAD (f7af91adc230aa99e23330ecf85bc9badd9780ad) Failed View Log HEAD (917719c412c48687d4a176965d1fa35320ec457c) Failed View Log
Thanks,
Ian
Quoted 41 lines · Ian Rogers
Quoted 30 lines · Yury Norov
Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Thu, 28 May 2026 15:26:28 -0400 Yury Norov <[email protected]> wrote:
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Thu, 28 May 2026 14:36:07 -0400 Yury Norov <[email protected]> wrote:
cpumap_print_to_pagebuf()is the equivalent for the "&*pb[l]" notation in printk-like functions. In some cases, it makes people to create temporary buffers for the printed cpumasks, where it can be avoided.Get rid of it in a favor of more standard printing API.
Each patch, except for the last one, is independent and may be moved with the corresponding subsystem. Or I can take it in bitmap-for-next, at maintainers' discretion.
On top of bitmap-for-next.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]OK... What should I do about that?
Rebase onto something which Sashiko *does* attempt. Mainline, a few mm.git branches. Maybe linux-next.
Is Sashiko a new mandatory requirement now? Documentation doesn't even mention the bot.
Quoted 6 lines
Quoted 2 lines
Roman, is there a list of trees/branches which Sashiko tries to apply series to?
Hi Roman,
Can you add bitmap-for-next in the list?
Fwiw, you can see the list of branches attempted and the SHA they are at in the Baseline drop down:
Quoted 12 lines
Baseline Status Log
tip/x86/core (0f61b1860cc3f52aef9036d7235ed1f017632193) Failed View Log powerpc/HEAD (6916d5703ddf9a38f1f6c2cc793381a24ee914c6) Failed View Log chanwoo/HEAD (7fd2df204f342fc17d1a0bfcd474b24232fb0f32) Failed View Log linux-arm/HEAD (dd6c438c3e64a5ff0b5d7e78f7f9be547803ef1b) Failed View Log linux-pm/HEAD (e7ae89a0c97ce2b68b0983cd01eda67cf373517d) Failed View Log linux-fpga/HEAD Failed View Log
pci/HEAD (254f49634ee16a731174d2ae34bc50bd5f45e731) Failed View Log linux-pm/thermal (21c315342b81526874acfa311f11b3f72bed4e14) Failed View Log rdma/HEAD (67464f388d52ec172be62c99fc43697437ffa384) Failed View Log linux-next/HEAD (f7af91adc230aa99e23330ecf85bc9badd9780ad) Failed View Log HEAD (917719c412c48687d4a176965d1fa35320ec457c) Failed View Log
Thanks, Ian. Bitmap-for-next is tracked with linux-next.
Andrew Morton
maintainerQuoted 10 lines · On Thu, 28 May 2026 15:32:34 -0400 Yury Norov <[email protected]> wrote:
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Sashiko doesn't attempt bitmap-for-next, so it couldn't apply this series.
https://sashiko.dev/#/patchset/[email protected]OK... What should I do about that?
Rebase onto something which Sashiko *does* attempt. Mainline, a few mm.git branches. Maybe linux-next.
Is Sashiko a new mandatory requirement now? Documentation doesn't even mention the bot.
It's early days and things are still evolving.
No, I'm not aware of any team having made it mandatory but boy it's helpful. Authors appreciate it because it finds bugs, and nobody wants to add bugs to Linux.