Skip to content

genirq, perf: Cleanup the abuse of irq_set_affinity_hint()

Thomas Gleixner linux-arm-kernel lkml 1 version Applied

Status from this message: The following commit has been merged into the irq/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/8genirq: Export affinity setter for modulesinclude/linux/interrupt.h kernel/irq/manage.c+34 -340 replies
2/8perf/arm-ccn: Use irq_set_affinity()drivers/perf/arm-ccn.c+2 -40 replies
3/8perf/arm-cmn: Use irq_set_affinity()drivers/perf/arm-cmn.c+2 -70 replies
4/8perf/arm-dmc620: Use irq_set_affinity()drivers/perf/arm_dmc620_pmu.c+2 -30 replies
5/8perf/arm-dsu: Use irq_set_affinity()drivers/perf/arm_dsu_pmu.c+2 -62 replies
6/8perf/arm-smmuv3: Use irq_set_affinity()drivers/perf/arm_smmuv3_pmu.c+3 -70 replies
7/8perf/imx_ddr: Use irq_set_affinity()drivers/perf/fsl_imx8_ddr_perf.c+2 -30 replies
8/8perf/hisi: Use irq_set_affinity()drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c drivers/perf/hisilicon/hisi_uncore_hha_pmu.c drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +3 more+2 -170 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMark Rutland
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 0/8] genirq, perf: Cleanup the abuse of irq_set_affinity_hint()

The modular PMU drivers use irq_set_affinity_hint() to set the affinity for the PMU interrupts, which relies on the undocumented side effect that this function actually sets the affinity under the hood.

Setting an hint is clearly not a guarantee and for these PMU interrupts an affinity hint, which is supposed to guide userspace for setting affinity, is beyond pointless, because the affinity of these interrupts cannot be modified from user space.

Aside of that the error checks are bogus because the only error which is returned from irq_set_affinity_hint() is when there is no irq descriptor for the interrupt number, but not when the affinity set fails. That's on purpose because the hint can point to an offline CPU.

Sigh, if people would at least talk if something is missing...

Clean up the mess by exposing irq_set_affinity() and converting the drivers over to that.

Thanks,

tglx

---
 drivers/perf/arm-ccn.c                        |    6 +---
 drivers/perf/arm-cmn.c                        |    9 +-----
 drivers/perf/arm_dmc620_pmu.c                 |    5 +--
 drivers/perf/arm_dsu_pmu.c                    |    8 +----
 drivers/perf/arm_smmuv3_pmu.c                 |   10 ++-----
 drivers/perf/fsl_imx8_ddr_perf.c              |    5 +--
 drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c |    3 --
 drivers/perf/hisilicon/hisi_uncore_hha_pmu.c  |    3 --
 drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c  |    3 --
 drivers/perf/hisilicon/hisi_uncore_pa_pmu.c   |    3 --
 drivers/perf/hisilicon/hisi_uncore_pmu.c      |    4 +-
 drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c |    3 --
 include/linux/interrupt.h                     |   35 +-------------------------
 kernel/irq/manage.c                           |   33 +++++++++++++++++++++++-
 14 files changed, 49 insertions(+), 81 deletions(-)