Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2447478ybh; Fri, 24 Jul 2020 13:06:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjFPPpKJ7L4u3lxFcE+/T63o5vMDd7tFmpHQe/ZJszYjXQP5xhMpW9Y10MV8by7QcAB+49 X-Received: by 2002:a17:906:1c0e:: with SMTP id k14mr4536611ejg.479.1595621203178; Fri, 24 Jul 2020 13:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595621203; cv=none; d=google.com; s=arc-20160816; b=zSo+EVmObHKPCwKPvIboHcZ7Qs0cOlDv3Ty/I5jeCNDE/dcbP3l7bE2HBI6v/q8Mj5 79wvmYsdCDnM/atflagBhV3PJr3h3h/k5YE9XQI9jq5/loSXQAb57D6hHnraoCMyfSNH ImVy1yq9xn5UnUFgXsY89tWxJAouie88Je/Sx5URdlyWRi9g4Gn+baffHESzOmnLl5Qt Jl7IbXB6Y29xRvy7ZV5uEPiKIR/YRow36/kNBkn9W66xePn+oAy6+libUWsgZWjUsszO 0q68JbULE0k3ZN5Ns6ENQxJQlm+sPIlbgEQjYNQj14qnTVh6WdhlRvCcoxO7D1MOxBHh UibA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=TeW9A/qlTP1o8VO5EnHYgVwdURE2GyvHXNk/PN9Dj5s=; b=0mhUWx0lvlaVufOKmtNUcUymCWo00GTJFxuTD/xrQkDBN/X+RqgZO2wIe2XmOgfqPr fRjUjMzc7V1FYWDvjKKHgOy+fveXsDV+R0Vurojbw/0k31/5we9aTIgti+0f+VQ7GdWN +NelYkekWggrfzGz8VfmHkWv73pKWImg41ufsf3ppkTJq8Kl9Gz/rZuXzRgWPZIFqNK5 03dsNYEGcM6W8vtBdPIbgKOSnhl0TULLDUxrs0ab1R8HUNyycWIiG7CfILt7o6syfaMt ZecuwqafpemoaQcN91CH9R5JMQfex4LDEBD0foaGyKdUXJvxPPcFEWDdCgKw6XZ/v0dQ SqDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BtmjxCtK; dkim=neutral (no key) header.i=@linutronix.de header.b=qr8Lr+Ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si1073031edi.269.2020.07.24.13.06.20; Fri, 24 Jul 2020 13:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BtmjxCtK; dkim=neutral (no key) header.i=@linutronix.de header.b=qr8Lr+Ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgGXUDx (ORCPT + 99 others); Fri, 24 Jul 2020 16:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGXUDx (ORCPT ); Fri, 24 Jul 2020 16:03:53 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E003C0619D3 for ; Fri, 24 Jul 2020 13:03:53 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595621031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TeW9A/qlTP1o8VO5EnHYgVwdURE2GyvHXNk/PN9Dj5s=; b=BtmjxCtK8ctJgLSe8EjHUW2wx6+tzgzp71S39DtmA2VdicGT1NKLEFXkmc9HsIB3Lr3uqj 2AiBktpkFXj8ke5ISYhdL28i6mjaV17dLXTqB6tEA3xGtwn98xeFrXJt3sW1poETBtmWm9 0CrIW8HmtVRk0qnCA/nrf8IWN8nVHUgWbXwwjLvuZwpH89EICdm8zRCPzCfs9JdN/zioQh IJIOquRNKpSBpgy2OUIh+EEzSyeo+/vpK0x42UhtTSDxNg16X2NZuxGUBm6z6c/LLyn5Tl 9dESUbP1iPqIuqnb1h9jhPnqg5QlMduPfBMYctzzg0LnWhN4rs1FQl5nSZcilA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595621031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TeW9A/qlTP1o8VO5EnHYgVwdURE2GyvHXNk/PN9Dj5s=; b=qr8Lr+Ay0lMnpkHs46mGO8NrG8s/Ha1Lws3i6vjRcQBpkm3avItorbjRTpQo+X+JYSPbgO +XbGzm/Q4bv/hJCQ== To: John Keeping Cc: LKML , x86@kernel.org, Ben Herrenschmidt , Ali Saidi , Marc Zyngier , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH V2] genirq/affinity: Handle affinity setting on inactive interrupts correctly In-Reply-To: <20200724182422.27ddced6.john@metanate.com> References: <87k0z2s2q3.fsf@nanos.tec.linutronix.de> <877dv2rv25.fsf@nanos.tec.linutronix.de> <20200724182422.27ddced6.john@metanate.com> Date: Fri, 24 Jul 2020 22:03:50 +0200 Message-ID: <87h7twu1cp.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org John, John Keeping writes: > On Fri, 17 Jul 2020 18:00:02 +0200 > Thomas Gleixner wrote: > It seems that this patch breaks perf events on RK3288 because the PMU > interrupts that should be per-cpu are now all on CPU0 so no events are > collected from CPUs 1-3 and those interrupts are killed as spurious > after a few seconds. > > I'm seeing this on 4.19.134 and 5.4.53 but as far as I can tell the > relevant code hasn't changed through to next-20200723. Reverting the > backport of this change fixes the problem. Bah. > It looks like what happens is that because the interrupts are not > per-CPU in the hardware, armpmu_request_irq() calls irq_force_affinity() > while the interrupt is deactivated and then request_irq() with > IRQF_PERCPU | IRQF_NOBALANCING. > > Now when irq_startup() runs with IRQ_STARTUP_NORMAL, it calls > irq_setup_affinity() which returns early because IRQF_PERCPU and > IRQF_NOBALANCING are set, leaving the interrupt on its original CPU. Right. My brain tricked me to believe that we made activation mandatory, but that's not. I have some ideas for a trivial generic way to solve this without undoing the commit in question and without going through all the irq chip drivers. So far everything I came up with is butt ugly. Maybe Marc has some brilliant idea. Sorry for the wreckage and thanks for the excellent problem description. I'll come back to you in the next days. Thanks, tglx