perf/arm-cmn: Clean up unnecessary NUMA_NO_NODE check
Subsystems (2)
Robin Murphy
maintainerPATCH 1/2 perf/arm-cmn: Clean up unnecessary NUMA_NO_NODE check
Checking for NUMA_NO_NODE is a misleading and, on reflection, entirely unnecessary micro-optimisation. If it ever did happen that an incoming CPU has no NUMA affinity while the current CPU does, a questionably- useful PMU migration isn't the biggest thing wrong with that picture...
---
Just a couple more little tweaks here, paying back some co-development from the NI driver.
drivers/perf/arm-cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
@@ -2023,7 +2023,7 @@ static int arm_cmn_pmu_online_cpu(unsigned int cpu, struct hlist_node *cpuhp_nod cmn = hlist_entry_safe(cpuhp_node, struct arm_cmn, cpuhp_node); node =dev_to_node (cmn->dev); -if (node !=NUMA_NO_NODE &&cpu_to_node (cmn->cpu) != node &&cpu_to_node (cpu) == node) +if (cpu_to_node (cmn->cpu) != node &&cpu_to_node (cpu) == node)arm_cmn_migrate (cmn, cpu);return 0 ; }
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Robin Murphy
maintainerPATCH 2/2 perf/arm-cmn: Improve format attr printing
Take full advantage of our formats being stored in bitfield form, and make the printing even more robust and simple by letting printk do all the hard work of formatting bitlists.
--- drivers/perf/arm-cmn.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/perf/arm-cmn.c +2 -6
@@ -1280,15 +1280,11 @@ static ssize_t arm_cmn_format_show(struct device *dev, struct device_attribute *attr, char *buf) { struct arm_cmn_format_attr *fmt = container_of(attr, typeof(*fmt), attr); -int lo =__ffs (fmt->field), hi =__fls (fmt->field); - -if (lo == hi) -return sysfs_emit (buf,"config:%d\n" , lo);if (!fmt->config) -return sysfs_emit (buf,"config:%d-%d\n" , lo, hi); +return sysfs_emit (buf,"config:%*pbl\n" ,64 , &fmt->field); -return sysfs_emit (buf,"config%d:%d-%d\n" , fmt->config, lo, hi); +return sysfs_emit (buf,"config%d:%*pbl\n" , fmt->config,64 , &fmt->field); }#define _CMN_FORMAT_ATTR (_name, _cfg, _fld) \
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Re: [PATCH 2/2] perf/arm-cmn: Improve format attr printing
Quoted 5 lines · Robin Murphy
Take full advantage of our formats being stored in bitfield form, and make the printing even more robust and simple by letting printk do all the hard work of formatting bitlists.
Signed-off-by Robin Murphy <[email protected]>
--Ilkka
Quoted 28 lines
---
drivers/perf/arm-cmn.c| 8 ++------1 file changed, 2 insertions(+), 6 deletions(-)drivers/perf/arm-cmn.c +2
-6@@ -1280,15 +1280,11 @@ static ssize_t arm_cmn_format_show(struct device *dev, struct device_attribute *attr, char *buf) { struct arm_cmn_format_attr *fmt = container_of(attr, typeof(*fmt), attr); -int lo =__ffs (fmt->field), hi =__fls (fmt->field); - -if (lo == hi) -return sysfs_emit (buf,"config:%d\n" , lo);if (!fmt->config) -return sysfs_emit (buf,"config:%d-%d\n" , lo, hi); +return sysfs_emit (buf,"config:%*pbl\n" ,64 , &fmt->field); -return sysfs_emit (buf,"config%d:%d-%d\n" , fmt->config, lo, hi); +return sysfs_emit (buf,"config%d:%*pbl\n" , fmt->config,64 , &fmt->field); }#define _CMN_FORMAT_ATTR (_name, _cfg, _fld) \Signature · 1 line
2.39.2.101.g768bb238c484.dirty
Quoted 6 lines · Robin Murphy
Checking for
NUMA_NO_NODEis a misleading and, on reflection, entirely unnecessary micro-optimisation. If it ever did happen that an incoming CPU has no NUMA affinity while the current CPU does, a questionably- useful PMU migration isn't the biggest thing wrong with that picture...
Applied to will (for-next/perf), thanks!
[1/2] perf/arm-cmn: Clean up unnecessary NUMA_NO_NODE check
https://git.kernel.org/will/c/f04b611e6650 [2/2] perf/arm-cmn: Improve format attr printing https://git.kernel.org/will/c/f32efa3e4bba
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev