Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp69521pxp; Wed, 16 Mar 2022 00:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1kUjTy5LGpo/CkX8Zklcz9wWn2BbGyhvkXjJwYtLzGDexYsNCTRgFevO6eXZO56J9zunD X-Received: by 2002:a17:906:19c6:b0:6ce:98a4:5ee6 with SMTP id h6-20020a17090619c600b006ce98a45ee6mr25026450ejd.567.1647414492353; Wed, 16 Mar 2022 00:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647414492; cv=none; d=google.com; s=arc-20160816; b=GH96aQGgJwvhPnOmyvPo9/zBeoCZSIYSOPBqKw6DwPd98iQpDRwdKZMX0dIYBZLY0O dB8spyDuYZTcJ/GVtc7nY8WOn3R5Ds7yp9PzvkqndJ8wmMnnnmRr8LuIp2eZG/oJZFAp PDPrZCIKv8Nk9jKjSoAFkaz1tBK7ouuJTmHGYa+ntYOx0lXSxj45PjqMHWDQerF4PQ6J VoGiE1UMgi4RDWeLVJ2OXd4Z0ffgLPz+CLWFGqdRWLyLHNvntIz1BIGQP+9pLOmDYGbx a07yR/YpBvQCDPFKw7XceiNfDPUdwz6upHydJEHtOmhUCx2BsuN/J2gZ4baNiwtGHqC5 FQPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=5ZIfmwWb2WbJZ9l5iSAxqdfWYYMc+kkAzn78elxgggk=; b=LGlUVUUWlEa307YKxWoBysch1k5EepaAWqCX+URmlLvDwHmMiddGQeIiSTNVBM/1aS 6AyAyd4QheNq9z1Ds8HcFSlCnbdWdXCb64y9PNuF0eNvklEpVx5xzjbga4iG5NjGxyI9 KGuY8YTIsyHDXpQT0UB2kjc0toQAV1vJCf7lol0YQLOdlow35hiiVK9llaCpGPkliAJR MHCooEhSkRqzMPoR0pDGiQD+VtA0MI4wVXBvIlI+9SSeJIz3ZXkM+qYZ+6Ymz4QY9Unp jGoQqviWjoz7jH3awAssHtujzp27/0FnRWczsQ58j3mPyx730sFrArLHFYIVCyXWmq7s DjCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=2QnjM1Se; dkim=neutral (no key) header.i=@linutronix.de header.b="tpO0fU//"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 28-20020a17090602dc00b006cf6e2597desi702298ejk.562.2022.03.16.00.07.46; Wed, 16 Mar 2022 00:08:12 -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=@linutronix.de header.s=2020 header.b=2QnjM1Se; dkim=neutral (no key) header.i=@linutronix.de header.b="tpO0fU//"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241361AbiCNP2Y (ORCPT + 99 others); Mon, 14 Mar 2022 11:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238922AbiCNP2W (ORCPT ); Mon, 14 Mar 2022 11:28:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8830A13F36 for ; Mon, 14 Mar 2022 08:27:12 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647271631; 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=5ZIfmwWb2WbJZ9l5iSAxqdfWYYMc+kkAzn78elxgggk=; b=2QnjM1SeFWxXmJrw27fv2lIzu0ACfZAFozfFjteT+xHMtXsfF821fzXo+5gKYuh3xAPdyD czbvQ/DTUU921vAI3StVMgkWQRUVomVzBpQlZ0o1sBX59pKhfEoIlmg/mT0C/jbF0ENGF/ hiCXx49XArdd0701qfLuyJzY4u5qqCl4Dv/tNhK1OiJ2K1BYdKjIAhTE+VcTJa6brT7CpX qSeaq/BRvxwb/9WO7OwFG8JnSRsJ8wEMnj4xDPV7FhBtuhwchpwmBx1z6VNhErSOVaIxwn q0O22qmftUMD6dCPFgPsHJ4bS7FuGlrAJBCPD6PoZGudqOt5TI3Mvqq6bG3GRA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647271631; 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=5ZIfmwWb2WbJZ9l5iSAxqdfWYYMc+kkAzn78elxgggk=; b=tpO0fU//UaLJH0a/mguVPCt3eT9qjNJU9AVu0j4bJIuf5oev7+wLDGQIpB+pxwT5U9bVpn 5yr4AxND2pjfLMBA== To: Marc Zyngier , linux-kernel@vger.kernel.org Cc: John Garry , David Decotigny Subject: Re: [PATCH] genirq/msi: Shutdown managed interrupts with unsatifiable affinities In-Reply-To: <20220307190625.254426-1-maz@kernel.org> References: <20220307190625.254426-1-maz@kernel.org> Date: Mon, 14 Mar 2022 16:27:10 +0100 Message-ID: <87sfrkftbl.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, Mar 07 2022 at 19:06, Marc Zyngier wrote: > When booting with maxcpus=, interrupt controllers > such as the GICv3 ITS may not be able to satisfy the affinity of > some managed interrupts, as some of the HW resources are simply > not available. This is also true if you have offlined lots of CPUs, right? > In order to deal with this, do not try to activate such interrupt > if there is no online CPU capable of handling it. Instead, place > it in shutdown state. Once a capable CPU shows up, it will be > activated. > > Reported-by: John Garry > Reported-by: David Decotigny > Signed-off-by: Marc Zyngier > --- > kernel/irq/msi.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c > index 2bdfce5edafd..aa84ce84c2ec 100644 > --- a/kernel/irq/msi.c > +++ b/kernel/irq/msi.c > @@ -818,6 +818,18 @@ static int msi_init_virq(struct irq_domain *domain, int virq, unsigned int vflag > irqd_clr_can_reserve(irqd); > if (vflags & VIRQ_NOMASK_QUIRK) > irqd_set_msi_nomask_quirk(irqd); > + > + /* > + * If the interrupt is managed but no CPU is available > + * to service it, shut it down until better times. > + */ > + if ((vflags & VIRQ_ACTIVATE) && > + irqd_affinity_is_managed(irqd) && > + !cpumask_intersects(irq_data_get_affinity_mask(irqd), > + cpu_online_mask)) { > + irqd_set_managed_shutdown(irqd); Hrm. Why is this in the !CAN_RESERVE path and not before the actual activation call? Thanks, tglx