Received: by 10.192.165.148 with SMTP id m20csp1584193imm; Wed, 25 Apr 2018 22:15:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx49fD24VvHZGyAOewD0/JHfKmCWjoypfZ1lyOpDY9Ad/ouCzgNC4Ro6XoG4b00ao28zoI4Bc X-Received: by 10.99.127.87 with SMTP id p23mr25940865pgn.240.1524719743417; Wed, 25 Apr 2018 22:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524719743; cv=none; d=google.com; s=arc-20160816; b=D1J0EnhwLyyPVHUmk+G+ellWLjn5Lel7wFN/Cj24vbwu6e3Vd5mkYDVNpD40xsg31b bNHhSi26esio3dHwrjjAphLoduwzz30k/Zisx6VbZ8niVecHchxQFC4mTIdLWNSLPN+b 8z+BDR3zUrDpcXxQkoUs7FBnlE0AA/Jt4ZldbwhJghYAHde3t1kavmF1cg6mhT+cnGsc sBXAd91dNzVETPSEKnlszviS1Vijw0nZmWaQeKJEf4L6XLdwswRkH+5nE+nq/PKdfPIA Sl9OwJgbMxunuwE/sxbHSGPdJl0TWdORBacvmUXHSBND0/PpkE8Lu40G44mVYpVm+ccE VMhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=sVFYgs5eQiDrYrhrvK3gQDhrsg1nJtg9tY2zY8JIZus=; b=el2mckgXio3gIcGQ0xrCoUEaErvpsoh3/EukbBgO9ihvWbyO+NK2ZzWk1Gcms31x07 dBAFIq/IPGt0jvAiYmro/xvUEvMzMfJ4xOob5N1GSSJ1YbLNZ5v9NgNTv3BQQgEhGO/e ZN5U6gmB5K9Mng34H3UzdheMMOdExFtgxsN/3Ddmoj+qxJK35VYovogRumUl9uTx8FKn 8EUAXKZODh9ouTcHWBT8Ccyh5P/HTulfwaCBCA3gtCOGdnJFjSzvA/h+3dOZuvrbVW60 /p3cxBmWlM5OK5V9A4JC5c4ZtVCTk3luyBk7M1OXHD4Sb7ceV59F+J9PNUVIvrN/EZ4Q iIMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kvduoo03; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si15243563pgn.420.2018.04.25.22.15.28; Wed, 25 Apr 2018 22:15:43 -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; dkim=pass header.i=@linaro.org header.s=google header.b=kvduoo03; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbeDZFOZ (ORCPT + 99 others); Thu, 26 Apr 2018 01:14:25 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39991 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbeDZFOW (ORCPT ); Thu, 26 Apr 2018 01:14:22 -0400 Received: by mail-pf0-f193.google.com with SMTP id f189so8156254pfa.7 for ; Wed, 25 Apr 2018 22:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sVFYgs5eQiDrYrhrvK3gQDhrsg1nJtg9tY2zY8JIZus=; b=kvduoo03e/lu15T566bg5Aq2fEcR0KBn9bSyKyOMB3u61uLBbY3sEUg5GEw3LYdT+0 eXnhJ68TThpYgG7HBqPMcI3mYIoU7Klp+XcASb3LaGHu1lDKlLG2hwZKicwtQYHLM8j5 eEiK6FX6kyM6dRbg1+xlw04RDHCAoQYq03cA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sVFYgs5eQiDrYrhrvK3gQDhrsg1nJtg9tY2zY8JIZus=; b=cqqF2kFVjPtIF46RH1egKmVp70EksvuNTKRnn0UH+ovoG9X6OgV71taJa1CMSjd8zs lEgxEQZQopju3IgoIwys4A83e68UOmVnanVS0HhK9GqEMJmqYqbK6CVWMdqbPoLMFC5d aY19pPicDpKuboAa/Fq2ZLhDkS5EJMHLRjy87Zp/K6KvipwnGi8xazYyha0zARhUiRPO 30ypHEgOBBEbN970vBG+UwGAtIxGDrM/VsPu3lEwM3FmyEDf+kmcP1VEM+iqDbupIM5s oyC6RVBLQdHQltkcM2liG921vMLG1N+2GMQWrkZyHcxwSGNAzGLkJbCSm89QwikbLc0d NLOg== X-Gm-Message-State: ALQs6tCo0p99PhP+ly/14Gzti3suue8SlfjMCKqxrY+pNff4u78ISs/Z 5TSzh+zzs/+QSdSpU62mTO2VFQ== X-Received: by 10.99.95.209 with SMTP id t200mr8418939pgb.246.1524719662291; Wed, 25 Apr 2018 22:14:22 -0700 (PDT) Received: from localhost ([122.172.61.40]) by smtp.gmail.com with ESMTPSA id o88sm39941218pfk.91.2018.04.25.22.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 22:14:20 -0700 (PDT) Date: Thu, 26 Apr 2018 10:44:18 +0530 From: Viresh Kumar To: Shilpasri G Bhat Cc: rjw@rjwysocki.net, npiggin@gmail.com, benh@kernel.crashing.org, mpe@ellerman.id.au, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, ppaidipe@linux.vnet.ibm.com, svaidy@linux.vnet.ibm.com, stable@vger.kernel.org Subject: Re: [PATCH V3] cpufreq: powernv: Fix the hardlockup by synchronus smp_call in timer interrupt Message-ID: <20180426051418.vpwugncvivub43ej@vireshk-i7> References: <1524653971-4919-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524653971-4919-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-04-18, 16:29, 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 > --- > Changes from V2: > - Remove the check for active policy while requeing the migrated timer > Changes from V1: > - Remove smp_call in the pstate handler. Acked-by: Viresh Kumar -- viresh