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: 64821 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp502409lbc; Thu, 31 Mar 2016 20:29:34 -0700 (PDT) X-Received: by 10.98.86.146 with SMTP id h18mr27328745pfj.9.1459481373933; Thu, 31 Mar 2016 20:29:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13si18206579pfb.82.2016.03.31.20.29.33; Thu, 31 Mar 2016 20:29:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758268AbcDAD3c (ORCPT + 29 others); Thu, 31 Mar 2016 23:29:32 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:17361 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753675AbcDAD3a (ORCPT ); Thu, 31 Mar 2016 23:29:30 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.1 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; }