Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2514824rwl; Thu, 6 Apr 2023 11:16:07 -0700 (PDT) X-Google-Smtp-Source: AKy350aepUpWr5Van8/QzlDHuWA7FAm6TzN+Sdpf7+lM8jj2xrF6MGY4p/aaBuHIHGM+sDg35KpK X-Received: by 2002:a62:1802:0:b0:622:85e2:fb93 with SMTP id 2-20020a621802000000b0062285e2fb93mr7319535pfy.15.1680804966921; Thu, 06 Apr 2023 11:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680804966; cv=none; d=google.com; s=arc-20160816; b=ZlVIpsrWKBgSUmnFPBDKdvf3gLLioiAkxfKUvmJBjTLMBOpieQe05C1pmy0qbSq/xm Hk+eTC+oWlSCJeyYW4VHf0Pewn1m4Qdiw7xv9no5BIqqwtJlGtVbT5h4S364aYGOo7l9 160WYgbxqaSs1Rk6SpQF1Oj1zg8JFwwQPqzvvxJRVnFE+CtG3V2ZHoWBmRJsQng8NhTN +ortYj+37JSoQ5HRkI1AGcrqnb3sJEZ08p7ZVxOPVmj8LRlS5D45lKa9MtLVikzns418 xnRPK2moM83yGKJ1VwGubHBsrMjPr1/urGz30cnE3Ze1GaKl2NTJp8zQP/aUxJL2RIYb ZXvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=m8j3+11mjWqUYKGWjM37PJj3N8NR05QL+S5Ug4QfIns=; b=wwxTxplhziK1atBuI6F8MVvbbl4YiQCf37qfrjLitIisIvEDyevSw8PZs3LwxW+XXx hqOu9MZH3OM023HwoWe/K/OHIDko3CkeKS+wxKDCWaqRtEVlL78DUCBhrGFGLfjsLcxf Z9zAcKi6Gr4ERarnBde22gWY13tqQ57VK6pLKQJ3/24rS4CL8zdkXPUAp71J2SDNl1eo OKKPeRrED9VtapeJuX0hpKNevA1aGC9ZCHbjB4hpTCqbupgBb3zMCAmGLZ+OCZHgq0/j nEmbSCmQQVCmLk3T4eYbCOI2TEWITK03+KsB3LoeeK+pezr5xwRWMBWs94w+nK8M2aC5 103A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@metanate.com header.s=stronger header.b=mPP+3p3H; 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=NONE dis=NONE) header.from=metanate.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020aa7946c000000b006254bb74922si1818982pfq.328.2023.04.06.11.15.40; Thu, 06 Apr 2023 11:16:06 -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 (test mode) header.i=@metanate.com header.s=stronger header.b=mPP+3p3H; 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=NONE dis=NONE) header.from=metanate.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239490AbjDFSJM (ORCPT + 99 others); Thu, 6 Apr 2023 14:09:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjDFSJK (ORCPT ); Thu, 6 Apr 2023 14:09:10 -0400 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCD12D7F for ; Thu, 6 Apr 2023 11:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=m8j3+11mjWqUYKGWjM37PJj3N8NR05QL+S5Ug4QfIns=; b=mP P+3p3Hfy6yCIzaY9bvaTXU4v/XsSgSwcLB6scpju5pF2eecRvhgQm+73uQXINJopyxIE3jzimgw/w AuzYkrZRWUdM0I5HcQ1Tb0tSwfxlxQrQGfXSHH2ykZde4GOQ3X3sKtuedyKeHPeKhkLRB0LjiJ7zR slJCnKlTBc3wHEXoOFX86U0L+YCDxfW8Fm+G7246QBP5Uknv1nXjDvquMslMSFMEuLmSpX907aIVZ /SCQq1bI+RLaaHpFR/PMC4SdIlGwyDDdz/4DUMIsnVqEslB+RwMYtvj+vBZj81D2H0npbw5cwFLER lJ0wJHMtNgV9NUROseY3uCyQQjPWJR1w==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pkU2h-00053p-II; Thu, 06 Apr 2023 19:09:04 +0100 From: John Keeping To: Thomas Gleixner Cc: John Keeping , linux-kernel@vger.kernel.org Subject: [PATCH] genirq: update affinity of secondary threads Date: Thu, 6 Apr 2023 19:08:57 +0100 Message-Id: <20230406180857.588682-1-john@metanate.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated: YES X-Spam-Status: No, score=1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 For interrupts with secondary threads, the affinity is applied when the thread is created but if the interrupts affinity is changed later only the primary thread is updated. Update the secondary thread's affinity as well to keep all the interrupt's activity on the assigned CPUs. Signed-off-by: John Keeping --- kernel/irq/manage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 8ce75495e04f..4f76eb8b7fcf 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -189,9 +189,13 @@ void irq_set_thread_affinity(struct irq_desc *desc) { struct irqaction *action; - for_each_action_of_desc(desc, action) + for_each_action_of_desc(desc, action) { if (action->thread) set_bit(IRQTF_AFFINITY, &action->thread_flags); + if (action->secondary && action->secondary->thread) + set_bit(IRQTF_AFFINITY, + &action->secondary->thread_flags); + } } #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK -- 2.40.0