Received: by 10.192.165.148 with SMTP id m20csp1726819imm; Sat, 28 Apr 2018 04:16:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrpSaQsz3uH5rpAyr0z6y4oesXQuruYSSjZ6/2m4A7gA8jARMMCAyIo9Hj/5RaliyHm9lyr X-Received: by 2002:a63:6f82:: with SMTP id k124-v6mr4756052pgc.301.1524914194180; Sat, 28 Apr 2018 04:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524914194; cv=none; d=google.com; s=arc-20160816; b=Y8IDKBmSPORABtNjYIMZtbzO/vTyeUHHbyol39lkWbFv8jOeOD+4mooBHNOevIgsKU EaZEmulGJFiv8JRBoUbcS2rTmbLADg/KTfyszftiX9VKAL++ksizaLUo2JqfPuHVkNjK k4O6QtKSiqVefSmpKvWHXzX8sibsI3U0McGTXatwLFM9DEdAWxq0bBPV4JZT+axB6Nik 68MznctYOCoaR0RSLLTIwMhOqkDQ4WliDgK5iYcpTxqe6Q7/aqQXIGAiK+bOFKTh0MLe Rk+NuTlFmfWVL/iMX77YowhA0AvghCzAGCVBjWJzG4aaPC8SFC1QMt19RSaOonRpqzM0 4UJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=Z0BlSIWHREF5oMAYZQzEsWig6cFadEFiVR100lXQBe8=; b=EeWjvFsN4JeuaY7yLG8yRdlSukGk/HwR+XjfSC1NYrGf+jHziMFQiunVNTIns1Jrtp 9I5x39Ns2o00fK7iGvdQUjH12OXDCOSBTPom/QH0Nc9mfLJRwjt86/g55fyCRMa0w5JR TsoRsCV8rGGhYpVgxE8iF6hLNClliFv59CPO8oIVYxWbKcKtRedsV/I27iaf+PfSL1AX BZyAKXdEQQS15cAWoBA8/oSAd/B9QmirZYaRQQfXjLsSNn8JsfrTT5ifN6dY2BjB51y7 ME3UTS8ckFRgkumnhkxAbycXGQ690X5m0iGgEYxnbGIH7glfjGue88c9qjV71B0zAari rGQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si3384550plh.47.2018.04.28.04.15.45; Sat, 28 Apr 2018 04:16:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759866AbeD1LMs (ORCPT + 99 others); Sat, 28 Apr 2018 07:12:48 -0400 Received: from ozlabs.org ([203.11.71.1]:46557 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759789AbeD1LMq (ORCPT ); Sat, 28 Apr 2018 07:12:46 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 40Y7SX0BHHz9s0x; Sat, 28 Apr 2018 21:12:43 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: c0f7f5b6c69107ca92909512533e70258ee19188 In-Reply-To: <1524653971-4919-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> To: Shilpasri G Bhat , rjw@rjwysocki.net, viresh.kumar@linaro.org From: Michael Ellerman Cc: linux-pm@vger.kernel.org, ppaidipe@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, npiggin@gmail.com, stable@vger.kernel.org, Shilpasri G Bhat , linuxppc-dev@lists.ozlabs.org Subject: Re: [V3] cpufreq: powernv: Fix the hardlockup by synchronus smp_call in timer interrupt Message-Id: <40Y7SX0BHHz9s0x@ozlabs.org> Date: Sat, 28 Apr 2018 21:12:43 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-04-25 at 10:59:31 UTC, Shilpasri G Bhat wrote: > gpstate_timer_handler() uses synchronous smp_call to set the pstate > on the requested core. This causes the below hard lockup: > > [c000003fe566b320] [c0000000001d5340] smp_call_function_single+0x110/0x180 (unreliable) > [c000003fe566b390] [c0000000001d55e0] smp_call_function_any+0x180/0x250 > [c000003fe566b3f0] [c000000000acd3e8] gpstate_timer_handler+0x1e8/0x580 > [c000003fe566b4a0] [c0000000001b46b0] call_timer_fn+0x50/0x1c0 > [c000003fe566b520] [c0000000001b4958] expire_timers+0x138/0x1f0 > [c000003fe566b590] [c0000000001b4bf8] run_timer_softirq+0x1e8/0x270 > [c000003fe566b630] [c000000000d0d6c8] __do_softirq+0x158/0x3e4 > [c000003fe566b710] [c000000000114be8] irq_exit+0xe8/0x120 > [c000003fe566b730] [c000000000024d0c] timer_interrupt+0x9c/0xe0 > [c000003fe566b760] [c000000000009014] decrementer_common+0x114/0x120 > -- interrupt: 901 at doorbell_global_ipi+0x34/0x50 > LR = arch_send_call_function_ipi_mask+0x120/0x130 > [c000003fe566ba50] [c00000000004876c] > arch_send_call_function_ipi_mask+0x4c/0x130 > [c000003fe566ba90] [c0000000001d59f0] smp_call_function_many+0x340/0x450 > [c000003fe566bb00] [c000000000075f18] pmdp_invalidate+0x98/0xe0 > [c000003fe566bb30] [c0000000003a1120] change_huge_pmd+0xe0/0x270 > [c000003fe566bba0] [c000000000349278] change_protection_range+0xb88/0xe40 > [c000003fe566bcf0] [c0000000003496c0] mprotect_fixup+0x140/0x340 > [c000003fe566bdb0] [c000000000349a74] SyS_mprotect+0x1b4/0x350 > [c000003fe566be30] [c00000000000b184] system_call+0x58/0x6c > > One way to avoid this is removing the smp-call. We can ensure that the timer > always runs on one of the policy-cpus. If the timer gets migrated to a > cpu outside the policy then re-queue it back on the policy->cpus. This way > we can get rid of the smp-call which was being used to set the pstate > on the policy->cpus. > > Fixes: 7bc54b652f13 (timers, cpufreq/powernv: Initialize the gpstate timer as pinned) > Cc: [4.8+] > Reported-by: Nicholas Piggin > Reported-by: Pridhiviraj Paidipeddi > Signed-off-by: Shilpasri G Bhat > Acked-by: Nicholas Piggin > Acked-by: Viresh Kumar > Acked-by: Vaidyanathan Srinivasan Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/c0f7f5b6c69107ca92909512533e70 cheers