1. 11 7月, 2018 2 次提交
  2. 22 5月, 2018 1 次提交
    • M
      arm_pmu: simplify arm_pmu::handle_irq · 0788f1e9
      Mark Rutland 提交于
      The arm_pmu::handle_irq() callback has the same prototype as a generic
      IRQ handler, taking the IRQ number and a void pointer argument which it
      must convert to an arm_pmu pointer.
      
      This means that all arm_pmu::handle_irq() take an IRQ number they never
      use, and all must explicitly cast the void pointer to an arm_pmu
      pointer.
      
      Instead, let's change arm_pmu::handle_irq to take an arm_pmu pointer,
      allowing these casts to be removed. The redundant IRQ number parameter
      is also removed.
      Suggested-by: NHoeun Ryu <hoeun.ryu@lge.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0788f1e9
  3. 17 3月, 2018 1 次提交
  4. 16 3月, 2018 1 次提交
  5. 12 3月, 2018 1 次提交
    • P
      perf/core: Remove perf_event::group_entry · 8343aae6
      Peter Zijlstra 提交于
      Now that all the grouping is done with RB trees, we no longer need
      group_entry and can replace the whole thing with sibling_list.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Dmitri Prokhorov <Dmitry.Prohorov@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Valery Cherepennikov <valery.cherepennikov@intel.com>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      8343aae6
  6. 28 2月, 2018 1 次提交
    • W
      arm_pmu: Use disable_irq_nosync when disabling SPI in CPU teardown hook · b08e5fd9
      Will Deacon 提交于
      Commit 6de3f791 ("arm_pmu: explicitly enable/disable SPIs at hotplug")
      moved all of the arm_pmu IRQ enable/disable calls to the CPU hotplug hooks,
      regardless of whether they are implemented as PPIs or SPIs. This can
      lead to us sleeping from atomic context due to disable_irq blocking:
      
       | BUG: sleeping function called from invalid context at kernel/irq/manage.c:112
       | in_atomic(): 1, irqs_disabled(): 128, pid: 15, name: migration/1
       | no locks held by migration/1/15.
       | irq event stamp: 192
       | hardirqs last  enabled at (191): [<00000000803c2507>]
       | _raw_spin_unlock_irq+0x2c/0x4c
       | hardirqs last disabled at (192): [<000000007f57ad28>] multi_cpu_stop+0x9c/0x140
       | softirqs last  enabled at (0): [<0000000004ee1b58>]
       | copy_process.isra.77.part.78+0x43c/0x1504
       | softirqs last disabled at (0): [<          (null)>]           (null)
       | CPU: 1 PID: 15 Comm: migration/1 Not tainted 4.16.0-rc3-salvator-x #1651
       | Hardware name: Renesas Salvator-X board based on r8a7796 (DT)
       | Call trace:
       |  dump_backtrace+0x0/0x140
       |  show_stack+0x14/0x1c
       |  dump_stack+0xb4/0xf0
       |  ___might_sleep+0x1fc/0x218
       |  __might_sleep+0x70/0x80
       |  synchronize_irq+0x40/0xa8
       |  disable_irq+0x20/0x2c
       |  arm_perf_teardown_cpu+0x80/0xac
      
      Since the interrupt is always CPU-affine and this code is running with
      interrupts disabled, we can just use disable_irq_nosync as we know there
      isn't a concurrent invocation of the handler to worry about.
      
      Fixes: 6de3f791 ("arm_pmu: explicitly enable/disable SPIs at hotplug")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      b08e5fd9
  7. 20 2月, 2018 7 次提交
  8. 24 10月, 2017 1 次提交
  9. 09 8月, 2017 1 次提交
  10. 27 7月, 2017 1 次提交
    • W
      drivers/perf: arm_pmu: Request PMU SPIs with IRQF_PER_CPU · a3287c41
      Will Deacon 提交于
      Since the PMU register interface is banked per CPU, CPU PMU interrrupts
      cannot be handled by a CPU other than the one with the PMU asserting the
      interrupt. This means that migrating PMU SPIs, as we do during a CPU
      hotplug operation doesn't make any sense and can lead to the IRQ being
      disabled entirely if we route a spurious IRQ to the new affinity target.
      
      This has been observed in practice on AMD Seattle, where CPUs on the
      non-boot cluster appear to take a spurious PMU IRQ when coming online,
      which is routed to CPU0 where it cannot be handled.
      
      This patch passes IRQF_PERCPU for PMU SPIs and forcefully sets their
      affinity prior to requesting them, ensuring that they cannot
      be migrated during hotplug events. This interacts badly with the DB8500
      erratum workaround that ping-pongs the interrupt affinity from the handler,
      so we avoid passing IRQF_PERCPU in that case by allowing the IRQ flags
      to be overridden in the platdata.
      
      Fixes: 3cf7ee98 ("drivers/perf: arm_pmu: move irq request/free into probe")
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      a3287c41
  11. 11 4月, 2017 11 次提交
  12. 01 4月, 2017 3 次提交
    • M
      drivers/perf: arm_pmu: split irq request from enable · c09adab0
      Mark Rutland 提交于
      For historical reasons, we lazily request and free interrupts in the
      arm pmu driver. This requires us to refcount use of the pmu (by way of
      counting the active events) in order to request/free interrupts at the
      correct times, which complicates the driver somewhat.
      
      The existing logic is flawed, as it only considers currently online CPUs
      when requesting, freeing, or managing the affinity of interrupts.
      Intervening hotplug events can result in erroneous IRQ affinity, online
      CPUs for which interrupts have not been requested, or offline CPUs whose
      interrupts are still requested.
      
      To fix this, this patch splits the requesting of interrupts from any
      per-cpu management (i.e. per-cpu enable/disable, and configuration of
      cpu affinity). We now request all interrupts up-front at probe time (and
      never free them, since we never unregister PMUs).
      
      The management of affinity, and per-cpu enable/disable now happens in
      our cpu hotplug callback, ensuring it occurs consistently. This means
      that we must now invoke the CPU hotplug callback at boot time in order
      to configure IRQs, and since the callback also resets the PMU hardware,
      we can remove the duplicate reset in the probe path.
      
      This rework renders our event refcounting unnecessary, so this is
      removed.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      [will: make armpmu_get_cpu_irq static]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c09adab0
    • M
      drivers/perf: arm_pmu: manage interrupts per-cpu · 7ed98e01
      Mark Rutland 提交于
      When requesting or freeing interrupts, we use platform_get_irq() to find
      relevant irqs, backing this up with additional information in an
      optional irq_affinity table.
      
      This means that our irq request and free paths are tied to a
      platform_device, and our request path must jump through a number of
      hoops in order to determine the required affinity of each interrupt.
      
      Given that the affinity must be static, we can compute the affinity once
      up-front at probe time, simplifying the irq request and free paths. By
      recording interrupts in a per-cpu data structure, we simplify a few
      paths, and permit a subsequent rework of the request and free paths.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      [will: rename local nr_irqs variable to avoid conflict with global]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      7ed98e01
    • M
      drivers/perf: arm_pmu: rework per-cpu allocation · 2681f018
      Mark Rutland 提交于
      For historical reasons, we allocate per-cpu data associated with a PMU
      rather late, in cpu_pmu_init, after we've parsed whatever hardware
      information we were provided with.
      
      In order to allow use to store some per-cpu data early in the probe
      path, we need to allocate (and initialise) the per-cpu data earlier.
      This patch reworks the way we allocate the pmu and associated per-cpu
      data in order to make that possible.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      [will: make armpmu_{alloc,free} static
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2681f018
  13. 02 3月, 2017 1 次提交
  14. 25 12月, 2016 1 次提交
  15. 17 9月, 2016 1 次提交
  16. 09 9月, 2016 3 次提交
    • M
      drivers/perf: arm_pmu: expose a cpumask in sysfs · 48538b58
      Mark Rutland 提交于
      In systems with heterogeneous CPUs, there are multiple logical CPU PMUs,
      each of which covers a subset of CPUs in the system. In some cases
      userspace needs to know which CPUs a given logical PMU covers, so we'd
      like to expose a cpumask under sysfs, similar to what is done for uncore
      PMUs.
      
      Unfortunately, prior to commit 00e727bb ("perf stat: Balance
      opening and reading events"), perf stat only correctly handled a cpumask
      holding a single CPU, and only when profiling in system-wide mode. In
      other cases, the presence of a cpumask file could cause perf stat to
      behave erratically.
      
      Thus, exposing a cpumask file would break older perf binaries in cases
      where they would otherwise work.
      
      To avoid this issue while still providing userspace with the information
      it needs, this patch exposes a differently-named file (cpus) under
      sysfs. New tools can look for this and operate correctly, while older
      tools will not be adversely affected by its presence.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      48538b58
    • M
      drivers/perf: arm_pmu: only use common attr_groups · 1589680d
      Mark Rutland 提交于
      Now that the 32-bit and 64-bit perf backends use the common groups
      directly, remove the fallback and no longer allow the groups array to be
      overridden.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      1589680d
    • M
      drivers/perf: arm_pmu: add common attr group fields · 86cdd72a
      Mark Rutland 提交于
      In preparation for adding common attribute groups, add an array of
      attribute group pointers to arm_pmu, which will be used if the
      backend hasn't already set pmu::attr_groups.
      
      Subsequent patches will move backends over to using these, before adding
      common fields.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      86cdd72a
  17. 07 9月, 2016 1 次提交
  18. 03 9月, 2016 2 次提交