From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679AbbJUH4L (ORCPT ); Wed, 21 Oct 2015 03:56:11 -0400 Received: from mail.windriver.com ([147.11.1.11]:58875 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751695AbbJUH4J (ORCPT ); Wed, 21 Oct 2015 03:56:09 -0400 From: roy.qing.li@gmail.com To: linux-kernel@vger.kernel.org, will.deacon@arm.com Subject: [PATCH] ARM: perf: ensure the cpu is available to scheduler when set irq affinity Date: Wed, 21 Oct 2015 15:56:02 +0800 Message-Id: <1445414162-12414-1-git-send-email-roy.qing.li@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Li RongQing when there are 4 cpus, but only one is available to schedule, the warning will be generated when run the below command: # perf record -g -e cpu-clock -- find / -name "*.ko" CPU PMU: unable to set irq affinity (irq=28, cpu=1) CPU PMU: unable to set irq affinity (irq=29, cpu=2) CPU PMU: unable to set irq affinity (irq=30, cpu=3) so ensure the cpu is available to scheduler when set irq affinity Signed-off-by: Li RongQing --- drivers/perf/arm_pmu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 2365a32..9401aa8 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -619,6 +619,9 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) if (cpu_pmu->irq_affinity) cpu = cpu_pmu->irq_affinity[i]; + if (!cpu_online(cpu)) + continue; + if (!cpumask_test_and_clear_cpu(cpu, &cpu_pmu->active_irqs)) continue; irq = platform_get_irq(pmu_device, i); @@ -665,6 +668,9 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler) if (cpu_pmu->irq_affinity) cpu = cpu_pmu->irq_affinity[i]; + if (!cpu_online(cpu)) + continue; + /* * If we have a single PMU interrupt that we can't shift, * assume that we're running on a uniprocessor machine and -- 2.1.4