Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp891807pxp; Wed, 16 Mar 2022 20:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCAc8l4W5oHHB+riIhe3bka3QPh/6+2s3Fh5wMK5a4ybMmaKqZuTpKWZUQdAveOtAxIXRx X-Received: by 2002:a63:4e:0:b0:37f:f3f0:2d24 with SMTP id 75-20020a63004e000000b0037ff3f02d24mr2025656pga.526.1647487364550; Wed, 16 Mar 2022 20:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647487364; cv=none; d=google.com; s=arc-20160816; b=fdyd3OJsAlUaQr88JStkhzd/Odr0IxKvXYaLuFEjehSoDTFmiXmeJT7ydIwONbQF9H W2NfE2XOLeh6twQKEcFPGjsRBb3vD7d+m/CkKmIJcCFE+TI5ay7jWF+oUKcJPuJQRJMH hdWvfcgHoYsBmBMqSQymJ1nGr3Oy0WoiJXc+kVdTNd+YeiZbhrMZjyTjwR0fCFlLp62d QhQMmf8brCD+YDpEd2fKpMykNeBS0WLMxoK30vX8ciwDLKbbf6llpcpgl5WN4IAus8z2 fNMMsagTAwOYP9rYx3fmPPgrPyoZa/TsHzKJxy1QzpB4ogHsB83X4OgS8ToWecbUmzf9 B3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=I1M/lzWxdv/KK5SOIxjXCMee+GQQprCC/ImH1Nz+VkE=; b=Vp9O8HOJweDWznNmQS3EdJ4CTUvjB0EaKUZZ3S8S5CDeaG7v3OKDJdG4J3ZY6Vp82W ywMe4ufwbu7CxQip2AVy9iWJKAKkd+SHAERshhDvqe4h/Ec1fnIVx92HH8sTzLcgnAQP dZKL7FkA3YtYUehM7S5049tZJgyGfq4JfZIrFY/JnArOqBLhjvf5pzeeMgNaoeELswFY xroyNZSZMciVY8Ko8QCxSUcEKO3kZ8nzvxgSrwc9cf80mkmoqonV1M7Tun/GmRREKjVA N9LoonwC2BxI+rKIyp12M8pTKS7NzwbIMF6r86iQK1Kom9dZBLwSIMm5s4tGrQzSScGM WWKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jH/a00zq"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c27-20020a630d1b000000b003816043f0fdsi846182pgl.754.2022.03.16.20.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:22:44 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jH/a00zq"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8659429832; Wed, 16 Mar 2022 20:22:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235250AbiCOJso (ORCPT + 99 others); Tue, 15 Mar 2022 05:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346860AbiCOJsI (ORCPT ); Tue, 15 Mar 2022 05:48:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DA44EF49 for ; Tue, 15 Mar 2022 02:46:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9A0B2B81100 for ; Tue, 15 Mar 2022 09:46:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42898C340E8; Tue, 15 Mar 2022 09:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647337614; bh=y1M717vi07aybTwxIruliIpZNcU5zWi08PSUU/8vXv4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jH/a00zqv1MYb2N08yoHEUkci5MWdhZR8E5GTPlfSBmxOAKjTpHjdoE0j7yBJPpv5 MLAylman6eRV+VS4ChVBzx6EMH6mUlXuf5zJqZdDm7L2Y4M4OU4xOB/ySPHiGc5zCg pmBATuX9/ePhxhtpd37VnoXHv5/h13VdaSUwyy+ZZShM8NIVaquMRmGXBc12QEL40m l9+PagT9bgEdk3c2pl1rpbJ71xaj/x5LyQKJpVRbYXVaMZuiYOvt7z1JNfft14qOdk bFWa5gjNep15O63iyA5kxbnV2A+JMsFqUY5rVJmSBn/XZGSWaKDvglqdBzxTgQ0mCI z2YUuJpXfiYbQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nU3lT-00EbZM-SZ; Tue, 15 Mar 2022 09:46:51 +0000 Date: Tue, 15 Mar 2022 09:46:51 +0000 Message-ID: <87fsnjzgxg.wl-maz@kernel.org> From: Marc Zyngier To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, John Garry , David Decotigny Subject: Re: [PATCH] genirq/msi: Shutdown managed interrupts with unsatifiable affinities In-Reply-To: <87mthsfjai.ffs@tglx> References: <20220307190625.254426-1-maz@kernel.org> <87sfrkftbl.ffs@tglx> <87ilsgzfpv.wl-maz@kernel.org> <87mthsfjai.ffs@tglx> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: tglx@linutronix.de, linux-kernel@vger.kernel.org, john.garry@huawei.com, ddecotig@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 14 Mar 2022 19:03:49 +0000, Thomas Gleixner wrote: > > 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? Ah! yes, that's the exact same problem (modular drivers? that's an idea that will never catch on...). > > >> > + /* > >> > + * 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. Yup, I'll add that. Thanks, M. -- Without deviation from the norm, progress is not possible.