Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp93865rwd; Tue, 30 May 2023 16:53:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Mv/5PfttR4RJ1qBjQZleY4oWIO1s89zKR14JAzO69BCNGSrb4X9Rdlo/Xv2vtCkdoRGsW X-Received: by 2002:a05:6a00:15c6:b0:64f:e997:510a with SMTP id o6-20020a056a0015c600b0064fe997510amr4763273pfu.3.1685490837829; Tue, 30 May 2023 16:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685490837; cv=none; d=google.com; s=arc-20160816; b=Ci3fRRINw2Kq1vyXpJD/zfAR/dCd4grdcloZbm9Rd1CNycTZGoKFSljnKYu0eC+PvL Jsj57VrimIhIWGm1909SWvmbzSVWHCdML9M0qg2gXemBrX0GMdMHa3je1GHAk+dcmikh eHdJ6bglrbwsdTyMvZ1RVMJzOseIqrn+4a4hmonvwxt9+TdoSTAWYPEhKhy/sVmEX+cU YVvjjb4iWl6jPfcJQn6RM1ASBMyTKCpTohGclX9JPx+cRe5Aa44taaraBGr2RuU920Sx pW5QrBfy8DOFk5CssbKBGfHlJgLp0WkjNhsPbOFrpSDfb9Vh1wQ3BPkIjY0Y2Y8jzYO0 ygfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nDJNB5RsBNc/267tcoLdyXS5Pr7u3K4HW7e+y/CbLTI=; b=gTxrZkjLEJP0ZmGVHDSr2Bbr3/dNltfiSAl22ZUmNAnfvm71A6cPtjX7mr6nr/rYSQ WrVT1xPRSubpKe4mP83nN9aR6zxHbRk4T2QYh9RO6ftd9/fGCmfnvxGTwr1S6rex+kGS 0vSjvXkIBTixe4YANSbjGgBQximeaaf2DufsO5efFEbHujHJHxLJqp8s6IFt25SQ23xu teq5RtEgYCMqvsiUOiA27/8UMKrVnr9Sro8tjYvVh1OoPanP8L4OcoBOzAGQ9pTnGalr 4sbQraZgrNqyyqXorfPC+0dvB/g9JWchC1VMbGndan0mnkhTsgtO+QDq2NG1eD7e7hyW h5HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=S3uWmXaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p124-20020a622982000000b006439b23e8b7si2450451pfp.9.2023.05.30.16.53.46; Tue, 30 May 2023 16:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=S3uWmXaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233711AbjE3Xcu (ORCPT + 99 others); Tue, 30 May 2023 19:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbjE3Xcs (ORCPT ); Tue, 30 May 2023 19:32:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC02AA for ; Tue, 30 May 2023 16:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=nDJNB5RsBNc/267tcoLdyXS5Pr7u3K4HW7e+y/CbLTI=; b=S3uWmXaNkVmx1wLRs+WbmhKzhJ f1eOkqSZI4hppj8w4KQ9eGmbxaDeAtvXJqe+ZqXnM6iTM4oAkntGWVNzJ2zjzV91ucuuA5IqCeErn Gz/vCc+XLzeROXBTY8YA4IZbEk/6xYtbubw1vmqheD3AdhnGQ1NJDTNrp58umiJyXgpr1O00imNhO X0Xjs/4dooG4GwVSVeG40UOPQBmdOVrQNB5bI9nsPkQQUE07TD3blp8Pt5B5AvXXNqO5RvDBQhM+Q UnRKnkNxNXnLMG4ofH+zyoRfF553bWfO3f9F8vAbm17TAeMmCF4/S75PdchNrDNMTbKcMOQRw79/r 4CEbJrCw==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q48pX-00FUCe-25; Tue, 30 May 2023 23:32:43 +0000 Message-ID: <89452cc1-5322-58f1-0f4a-41c2ad201be7@infradead.org> Date: Tue, 30 May 2023 16:32:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/2] genirq: fasteoi resends interrupt on concurrent invoke Content-Language: en-US To: James Gowans , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Liao Chang , Marc Zyngier , KarimAllah Raslan , Yipeng Zou , Zhang Jianhua References: <20230530213848.3273006-1-jgowans@amazon.com> <20230530213848.3273006-2-jgowans@amazon.com> From: Randy Dunlap In-Reply-To: <20230530213848.3273006-2-jgowans@amazon.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi-- On 5/30/23 14:38, James Gowans wrote: > --- > kernel/irq/chip.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c > index 49e7bc871fec..42f33e77c16b 100644 > --- a/kernel/irq/chip.c > +++ b/kernel/irq/chip.c > @@ -692,8 +692,15 @@ void handle_fasteoi_irq(struct irq_desc *desc) > > raw_spin_lock(&desc->lock); > > - if (!irq_may_run(desc)) > + /* > + * When an affinity change races with IRQ delivery, the next interrupt > + * can arrive on the new CPU before the original CPU has completed > + * handling the previous one. Mark it as pending and return EOI. > + */ > + if (!irq_may_run(desc)) { > + desc->istate |= IRQS_PENDING; > goto out; > + } > > desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); > > @@ -715,6 +722,12 @@ void handle_fasteoi_irq(struct irq_desc *desc) > > cond_unmask_eoi_irq(desc, chip); > > + /* > + * When the race descibed above happens, this will resend the interrupt. described > + */ > + if (unlikely(desc->istate & IRQS_PENDING)) > + check_irq_resend(desc, false); > + > raw_spin_unlock(&desc->lock); > return; > out: -- ~Randy