From patchwork Fri Jul 13 14:03:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 10523401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4B816032C for ; Fri, 13 Jul 2018 14:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D3FA296EF for ; Fri, 13 Jul 2018 14:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 913202985E; Fri, 13 Jul 2018 14:04:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E776C296EF for ; Fri, 13 Jul 2018 14:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LV9nny2dcKxzLRvvrDRtL0JILbVyhavMWCN5f/QIins=; b=oFAdQjiPmV8bKK IibFax3ES/Dty9OfpX2RH5unathN3YgbYyG3vAvzA95pBSitW3YNOxpoBwDDXAHG0JcO9Gp4ndJMP 1enc+M2m4nBgQ1VGfM44AbXS6lgapRSQFy8lkmdc+eTnKNFYOcX+QyjC16ZgltxgD1hdi3w+YfK2m q2ey8WWPyE2AsGSzo4eirNnIg/bSIA2uNQ7OxUZ0BeG7tgTinDkBXgYUtrOMZfx5HcrZhztRmXe3T 9qdoXqKruib7m28OIJFRjjrK/xkeEUXcq9PUEn6fz2bcobYYYvn7V0nJrtXJB+7FhRmxUELAT13ki Hhj1te3/ty34+GZiPw0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdyg7-0005kX-1p; Fri, 13 Jul 2018 14:04:11 +0000 Received: from mail-ve1eur01on0121.outbound.protection.outlook.com ([104.47.1.121] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdyg2-0005jy-Tm for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2018 14:04:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x+JDBz96tGeCf/xSnbkMdwt9OnwD8ZzfSfV10WItUds=; b=ojGE56PtH8QnZ2Li2oUlCIGO/thaYKKfDGgKlUPpgOfc0DCzwkU/Hy/mhMiBj4iBHk584mbdGZX5OBl+G/B0D4dk5A2kjKLWThkJiUR1IBABnAlNm6I/F4YTrGcwf1+mJbIwE9Bn/YWbju4U2YZMmQwATTLFcVjrq/tM9F7HopQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=alexander.sverdlin@nokia.com; Received: from ulegcpsvdell.emea.nsn-net.net (131.228.2.20) by VI1PR0701MB1885.eurprd07.prod.outlook.com (2603:10a6:800:39::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.7; Fri, 13 Jul 2018 14:03:51 +0000 From: Alexander Sverdlin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm: Use generic irq_migrate_all_off_this_cpu() for CPU hotplug Date: Fri, 13 Jul 2018 16:03:31 +0200 Message-Id: <20180713140331.1158-1-alexander.sverdlin@nokia.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [131.228.2.20] X-ClientProxiedBy: AM3PR07CA0101.eurprd07.prod.outlook.com (2603:10a6:207:7::11) To VI1PR0701MB1885.eurprd07.prod.outlook.com (2603:10a6:800:39::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a84b1e4-b8d9-4fb5-be4d-08d5e8c97771 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:(109105607167333); BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7193020); SRVR:VI1PR0701MB1885; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB1885; 3:1FgYMQ4YpBQoq06WOGFE+FVRwEbduylTfy11LInSL0/AuDGggSNs6duSZutP7jxfMXZNRhGvJmImRbg5lmj9lFgY7Iv9BdiUBzkI89SkNdr5Tqv3mHmdkS5nf6A+l1kMqdnC6PC/L67rl+EMLfunS434kGSHu7LexejkYWeFyhfawAglXjxkttvEN0m4H95LBogN66wIC4+4XbBXKQK1K2/q4W+yId74blBWp8QKLe8g9XFYh5ILfkK3UXaCKRHTEwhgXq4SUlpo5GlnHXvvbuDzxypG6z9lazbQB6YWcAc=; 25:ntQu4PVVc57RrbgW5cdBbMmW8PA8RfvdqnsdWjAehku+3JlgiWjNh6MVic/RF2l65qUQF9JMf1xyI+1BAcN3iL5Xns+rtoE8YngRBxfi/FEPOx6+z2eUqHV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Wqa+2ldTNXDzf19crS3vZrfi8PytrJYtK3pBbCSn47ZpbAyZjfgSKeNIag9wnWsU38A4YC8lb3szowUrcSE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597)(109105607167333); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(11241501184)(806099)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0701MB1885; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0701MB1885; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB1885; 4:XL+Vhg6X5XpHiPjWcOysyNUBKztAAk//O1OxNTWAglYqiPSJFnZZvZ6e/HcxRBZP6AE6mNK/2ivgtQpRjfxFqCZPl9TcKzonNKBeU5EBP4OQrhSIJWm6oVVNXWBQJ35DbTeDerKuILYORdsqTC6Z5wI65LHWL6cd5sbnDtJpmQcwvSPkDrpoMRQuiLTuz3gItYR82HoNfHKB4WrRUYh5gi7jk41HeEqwBiGt2aQWc4A5k8RYujEGF9WgrEggscTx0dP/L3ZXf5D6EHRO0ih6T3R8UWfLFuzDQ5OunMbt6Co0riqonwpmGjL/aRJMMCJC9wIasTuqLFeo/JtP4Q9F+BCGdjYYxpQ1egZG2FutMGI= X-Forefront-PRVS: 07326CFBC4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(136003)(376002)(39860400002)(346002)(396003)(366004)(189003)(199004)(7416002)(16586007)(51416003)(3846002)(6116002)(52116002)(36756003)(6512007)(316002)(5660300001)(1857600001)(81166006)(26005)(53936002)(2361001)(47776003)(1076002)(6666003)(16526019)(186003)(6506007)(66066001)(81156014)(478600001)(386003)(8936002)(8676002)(44832011)(50466002)(25786009)(6916009)(6486002)(68736007)(956004)(2616005)(486006)(476003)(106356001)(305945005)(105586002)(4326008)(14444005)(5024004)(48376002)(2906002)(54906003)(97736004)(2351001)(7736002)(50226002)(86362001)(41533002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0701MB1885; H:ulegcpsvdell.emea.nsn-net.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0701MB1885; 23:NV2hxkDHu8fPqsK8MxfqdsE2IZQtBD5sndURm6r?= =?us-ascii?Q?LtwdVN+eu4sQjxVH3BweLlrc1Fd5QYGsUyD2L/gVi13xjtu7bxFeA2I7VJKA?= =?us-ascii?Q?pNjpHt8CHNm3YPmFPoNjCMt/GUydfUiMzmIZrSA3qZMkIFueA1PhpksvTybu?= =?us-ascii?Q?0AsOJvpNKifWfRanBRKgSyHDo965Lnzy43pVI/UZ3+h5mEA5VibL+jSefCTO?= =?us-ascii?Q?k1ITKj1Eq9eg4+T5gjoN0FCHm9Lz+PQ0AaIbcadoaJSA3NURbcjigshRGeE6?= =?us-ascii?Q?shLOetowflRSknPIgOrc6HMxSz7xYy7uV6TIzaUvho/U/GopL0joAoXCUwLo?= =?us-ascii?Q?/O1hchh20hnuj0DHgEFVomgtCU87cF27Uq0KetB/Roo1STrVhO0+4xJdegCC?= =?us-ascii?Q?IG9Evc9/Ej2f/84VQJsj5IgGXG4S7MrIOc764rijr5I1rI11ajLXNWJ72pp+?= =?us-ascii?Q?rKZHFSuEao9umy1Cf9l1pVGPSab4nv9K/U9nQpJhKuPEkHcYd4wHZHRgfWVw?= =?us-ascii?Q?+TnGh9ihuH6f2o+fNScGctX3gCx3RxJoHZPx0Sj7j81cIJ2gwmX+Gr7wz9m0?= =?us-ascii?Q?2iQNUY0oU9MLOR7qJBS5ZB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B2AWRpx50AWAsA+1plM5mT4mxiRtSQMOZ1eP9xu+iOw7Q6VcEzG4hR8vUqsOp1Y1gZ1WB6j0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0701MB1885; 7:AKMDuzSpAQgEt2LIsnYrFM/GFNfEKZXnNyfyM0VZbr6vnYHZT/sqKknHNsoQQ6urRa0Z+Kva7LIXzMvIY/DUOMVINfdVD4P7jjEOUayaro5wpuij0aMSoZ8EcDfJhDbceWVQm216S3LgMe3ybcU9Svea5Bdvw0omYMy3GnUOm2AsXDi8Qi+PvDk91jzjslIxbCcRZZX3ur6OcEftQf1qvDYx4Ij4wIvO/U0qYAsvkhJZyFn751ZyVcl35/EZc5Xf X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 14:03:51.7564 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a84b1e4-b8d9-4fb5-be4d-08d5e8c97771 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB1885 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180713_070407_132460_4C8C9A3B X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Pitre , Mark Rutland , Arnd Bergmann , Marc Zyngier , Catalin Marinas , Will Deacon , Russell King , Alexander Sverdlin , Hanjun Guo , Yang Yingliang , Thomas Gleixner , Jiang Liu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP I have found that .irq_bus_lock/.irq_bus_sync_unlock of irqchip are not honored during CPU hotplug migration and the reason for this is open-coded IRQ affinity re-configuration in the existing ARM migrate_irqs() implementation. Fortunately, this was already fixed for ARM64 in 217d453d ("arm64: fix a migrating irq bug when hotplug cpu"). So, just switch to the same generic code for ARM. Signed-off-by: Alexander Sverdlin --- arch/arm/Kconfig | 1 + arch/arm/include/asm/irq.h | 1 - arch/arm/kernel/irq.c | 61 -------------------------------------- arch/arm/kernel/smp.c | 2 +- 4 files changed, 2 insertions(+), 63 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 843edfd000be..45a6cf925eec 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1449,6 +1449,7 @@ config NR_CPUS config HOTPLUG_CPU bool "Support for hot-pluggable CPUs" depends on SMP + select GENERIC_IRQ_MIGRATION help Say Y here to experiment with turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h index b6f319606e30..2de321e89b94 100644 --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -25,7 +25,6 @@ #ifndef __ASSEMBLY__ struct irqaction; struct pt_regs; -extern void migrate_irqs(void); extern void asm_do_IRQ(unsigned int, struct pt_regs *); void handle_IRQ(unsigned int, struct pt_regs *); diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index ece04a457486..a7e047127c05 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -119,64 +119,3 @@ int __init arch_probe_nr_irqs(void) return nr_irqs; } #endif - -#ifdef CONFIG_HOTPLUG_CPU -static bool migrate_one_irq(struct irq_desc *desc) -{ - struct irq_data *d = irq_desc_get_irq_data(desc); - const struct cpumask *affinity = irq_data_get_affinity_mask(d); - struct irq_chip *c; - bool ret = false; - - /* - * If this is a per-CPU interrupt, or the affinity does not - * include this CPU, then we have nothing to do. - */ - if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) - return false; - - if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { - affinity = cpu_online_mask; - ret = true; - } - - c = irq_data_get_irq_chip(d); - if (!c->irq_set_affinity) - pr_debug("IRQ%u: unable to set affinity\n", d->irq); - else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) - cpumask_copy(irq_data_get_affinity_mask(d), affinity); - - return ret; -} - -/* - * The current CPU has been marked offline. Migrate IRQs off this CPU. - * If the affinity settings do not allow other CPUs, force them onto any - * available CPU. - * - * Note: we must iterate over all IRQs, whether they have an attached - * action structure or not, as we need to get chained interrupts too. - */ -void migrate_irqs(void) -{ - unsigned int i; - struct irq_desc *desc; - unsigned long flags; - - local_irq_save(flags); - - for_each_irq_desc(i, desc) { - bool affinity_broken; - - raw_spin_lock(&desc->lock); - affinity_broken = migrate_one_irq(desc); - raw_spin_unlock(&desc->lock); - - if (affinity_broken) - pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n", - i, smp_processor_id()); - } - - local_irq_restore(flags); -} -#endif /* CONFIG_HOTPLUG_CPU */ diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 0978282d5fc2..a9ab8f9fd20f 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -225,7 +225,7 @@ int __cpu_disable(void) /* * OK - migrate IRQs away from this CPU */ - migrate_irqs(); + irq_migrate_all_off_this_cpu(); /* * Flush user cache and TLB mappings, and then remove this CPU