From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754842AbbISDIF (ORCPT ); Fri, 18 Sep 2015 23:08:05 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:37548 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754627AbbISDHk (ORCPT ); Fri, 18 Sep 2015 23:07:40 -0400 From: Yang Yingliang To: , CC: Yang Yingliang , Jiang Liu , Thomas Gleixner , "Marc Zyngier" , Mark Rutland , "Will Deacon" , Russell King - ARM Linux , Hanjun Guo Subject: [RFC PATCH v5 0/4] arm/arm64: fix a migrating irq bug when hotplug cpu Date: Sat, 19 Sep 2015 11:05:55 +0800 Message-ID: <1442631959-10228-1-git-send-email-yangyingliang@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.55FCD12F.0037,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0aeff3c9402310b845225dfcad8995f0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ---- Changes in v5: - remove the macro that guard move_irqs() - use name irq_migrate_all_off_this_cpu instead of move_irqs Changes in v4: - select GENERIC_IRQ_MIGRATION when config GENERIC_IRQ_MIGRATION is enabled - add move_irqs() into kerne/irq/migration.c for cpu hotplug - use move_irqs() to migrate interrupts on arm/arm64 when cpu is going to down - split bugfix patch into seperate patches for arm and arm64 Changes in v3: - introduce config GENERIC_IRQ_MIGRATION for compiling migration.c - rename migrate_irqs in arch/ia64/kernel/irq.c to avoid compiling error Changes in v2: - use the exiting helper to set IRQD_MOVE_PCNTXT flag - use for_each_active_irq() instead of for_each_irq_desc() - add some warn messages when affinity is null or do set affinity failed ---- Hi All, There is a bug: When cpu is disabled, all irqs will be migratged to another cpu. In some cases, a new affinity is different, it needed to be coppied to irq's affinity. But if the type of irq is LPI, it's affinity will not be coppied because of irq_set_affinity's return value. As Marc and Will suggested, I refactor the arm/arm64 migrating interrupts code and fix the migrating irq bug while cpu is offline. I'm trying let the core code do the migrating interrupts matter. kernel/irq/migration.c depends on CONFIG_GENERIC_PENDING_IRQ, so I introduce config GENERIC_IRQ_MIGRATION for compiling migration.c. Then add a generic function for migrating interrupts in migration.c. And then use the function when cpu is going to down on arm and arm64. Cc: Jiang Liu Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Mark Rutland Cc: Will Deacon Cc: Russell King - ARM Linux Cc: Hanjun Guo Yang Yingliang (4): genirq: introduce CONFIG_GENERIC_IRQ_MIGRATION genirq: add irq_migrate_all_off_this_cpu() for cpu hotplug arm64: fix a migrating irq bug when hotplug cpu arm: fix a migrating irq bug when hotplug cpu arch/arm/Kconfig | 1 + arch/arm/include/asm/irq.h | 1 - arch/arm/kernel/irq.c | 62 ----------------------------------------- arch/arm/kernel/smp.c | 2 +- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/irq.h | 1 - arch/arm64/kernel/irq.c | 62 ----------------------------------------- arch/arm64/kernel/smp.c | 2 +- include/linux/irq.h | 2 ++ kernel/irq/Kconfig | 5 ++++ kernel/irq/Makefile | 2 +- kernel/irq/migration.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 78 insertions(+), 129 deletions(-) -- 2.5.0