Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp898050pxp; Wed, 16 Mar 2022 20:34:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwasIqTCjjbLkqRrnDF8W/YkKmzzlFnXgWqVWGMKgMnXNd7kS5SJTjsSPKEjpaOQv+z6zLL X-Received: by 2002:a63:e854:0:b0:381:c98b:ce6f with SMTP id a20-20020a63e854000000b00381c98bce6fmr2137229pgk.370.1647488051746; Wed, 16 Mar 2022 20:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488051; cv=none; d=google.com; s=arc-20160816; b=Pf3DdzUrBmrUzic9Tc+dxE5t2i7xXzhVuGdzDuI0HsGdPq0QarE5WaRPXP99avC00J jhR+VoB93hhI4y0QftvOm2BH9IVgxqtoq6cTBs2S6xmxoxvk/dZVT8H+Tnb60M/nplo2 Fvu1vvDeJ5ZubwH3ssIBzdcq8BhBp6/+q3+a0MjSik+GRuhtM4l5jgD+VD9VrWSYKQm/ IpAeiC8o4rTIX09klJbhklk5YffnqVdxrbOOTMHbVfwYy8o7S47OIg7f+J2zSZ0YFtUc Qp0oz8YPn7+E1MIXxH4hXb4kF4GX4vEyNDXZF4PxCgqEXXO9Pn5gBAEvhhAg0D67Khcl i35A== 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=rr1I2k8yy6900xeEsxynWpaXe8KIZVUby5z1J+L4pXU=; b=Afb25GXbfpppPk2+TwlKdKvUH0+wm7u65yM77WKUvWae7W9a2FJL25h2pveFFyVruR 8EKYppjsEupo8bYdHQzHE+YGvRZmtAzldxK8OPKR4OA82cd9Y8lxzsRUU1hsWGsgT3Aa L5TNgYHuNibqxs183cRDKuQNleagDeZhH4Ln1SGYBdUYco7zUb6p3n1DgttlNM1JACtO ss+mjSOFwSlSRi7/WnBTAtyzd0MX0koSEQQw8aE1RKp1uR4hh71Ajdfsj+R/xYnB90h/ StNNdQMKLRkULU6kUwxTT4wD6gA5VyGIiHVu7wL2DVh6Ljol9OTdQTfei+1iZxwnny9Q cPEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bR6C4zGc; dkim=neutral (no key) header.i=@linutronix.de header.b=NvjcSqax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z2-20020a63b902000000b003816043f070si900865pge.613.2022.03.16.20.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:34:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bR6C4zGc; dkim=neutral (no key) header.i=@linutronix.de header.b=NvjcSqax; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA7F042ED0; Wed, 16 Mar 2022 20:29:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236835AbiCNTFH (ORCPT + 99 others); Mon, 14 Mar 2022 15:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235386AbiCNTFF (ORCPT ); Mon, 14 Mar 2022 15:05:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C243BB7EF for ; Mon, 14 Mar 2022 12:03:52 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647284630; 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=rr1I2k8yy6900xeEsxynWpaXe8KIZVUby5z1J+L4pXU=; b=bR6C4zGc0Iyp0yyhJvhYcxU0uFc7HWAXk8ICDrdjrk9YVSMsiOXbU/dc2QcafdZHvYQqgh iW6F5JTdIz+r7LW6qNUlAmPgmeprUfIbEAI2h3AYVKqg6LT/fFP+8q3BBcRsSJFVYUcj2l vX9nbOinYT1gcxHRRWeWF2A6JuUH9hcVZj/drmnrD4ul5G/SNFP6tXSeErHDG7xtkGpVUk JGTn4KVLj376BglcBXieUYLqWJMYs0DdgHkSz3s0GpKIYucQUzNlKRPcSwxoMVeMkm4tsH JdIZv0l2ucWZpM7YiRExqSLnQq1n6U4MsRowRWk0X+ePr2UZE29YXepEGcTo7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647284630; 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=rr1I2k8yy6900xeEsxynWpaXe8KIZVUby5z1J+L4pXU=; b=NvjcSqaxJGaUAD1TnH/uLzx2EWLLmCut6PUiv3PrqT1Spzfc7r0Nnpl5V+mBOg/P5dQTnB K+El4/EwmpzlUYBQ== To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, John Garry , David Decotigny Subject: Re: [PATCH] genirq/msi: Shutdown managed interrupts with unsatifiable affinities In-Reply-To: <87ilsgzfpv.wl-maz@kernel.org> References: <20220307190625.254426-1-maz@kernel.org> <87sfrkftbl.ffs@tglx> <87ilsgzfpv.wl-maz@kernel.org> Date: Mon, 14 Mar 2022 20:03:49 +0100 Message-ID: <87mthsfjai.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 14 2022 at 16:00, Marc Zyngier wrote: > On Mon, 14 Mar 2022 15:27:10 +0000, > Thomas Gleixner wrote: >> >> 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? > > Not quite. If you offline the CPUs, the interrupts will be placed in > the shutdown state as expected, having initially transitioned via an > activation state with an online CPU. The issue here is with the > initial activation of the interrupt, which currently happens even if > no matching CPU is present. Yes. But if you load the driver _after_ offlining lots of CPUs first then the same thing should happen, right? >> > + /* >> > + * 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? > > VIRQ_CAN_RESERVE can only happen as a consequence of > GENERIC_IRQ_RESERVATION_MODE, which only exists on x86. Given that x86 > is already super careful not to activate an interrupt that is not > immediately required, I though we could avoid putting this check on > that path. > > But if I got the above wrong (which is, let's face it, extremely > likely), I'm happy to kick it down the road next to the activation > call. I just rechecked. Yes, we could push it there, but actually on x86 the reservation mode activation sets the entry to a spurious catch all on an online CPU, which is intentional. So yes, we can keep it where it is now, but that needs a comment. Thanks, tglx