From patchwork Fri Apr 1 03:28:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "majun (F)" X-Patchwork-Id: 8720091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 54BF4C0553 for ; Fri, 1 Apr 2016 03:31:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A0C1202F0 for ; Fri, 1 Apr 2016 03:31:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B669C20251 for ; Fri, 1 Apr 2016 03:31:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1alpm5-0004gJ-9p; Fri, 01 Apr 2016 03:29:29 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alpm2-0004Tu-4B for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 03:29:28 +0000 Received: from 172.24.1.60 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.60]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DEM31302; Fri, 01 Apr 2016 11:28:25 +0800 (CST) Received: from localhost (10.177.235.245) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Fri, 1 Apr 2016 11:28:16 +0800 From: MaJun To: , , , , , , , , , , Subject: [RFC PATCH] genirq: Change the non-balanced irq to balance irq when the cpu of the irq bounded off line Date: Fri, 1 Apr 2016 11:28:11 +0800 Message-ID: <1459481291-10136-1-git-send-email-majun258@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.177.235.245] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56FDEADB.00D3, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 694c9fa7ada97f91c6c6acd768a13f7b X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160331_202927_189428_C8CCD56A X-CRM114-Status: GOOD ( 14.57 ) X-Spam-Score: -5.2 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ma Jun When the CPU of a non-balanced irq bounded is off line, the irq will be migrated to other CPUs, usually the first cpu on-line. We can suppose the situation if a system has more than one non-balanced irq. At extreme case, these irqs will be migrated to the same CPU and will cause the CPU run with high irq pressure, even make the system die. So, I think maybe we need to change the non-balanced irq to a irq can be balanced to avoid the problem descried above. Maybe this is not a good solution for this problem, please offer me some suggestion if you have a better one. Signed-off-by: Ma Jun --- kernel/irq/cpuhotplug.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 011f8c4..80d54a5 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -30,6 +30,8 @@ static bool migrate_one_irq(struct irq_desc *desc) return false; if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { + if (irq_settings_has_no_balance_set(desc)) + irqd_clear(d, IRQD_NO_BALANCING); affinity = cpu_online_mask; ret = true; }