forked from huaijin-chen/taobao-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug for ksoftirqd high cpu usage.
sched: Add irq_{enter,exit}() to scheduler_ipi() - patches.taobao/sched-fix-ksoftirqd-high-usage.patch:
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
------------------------------------------------------------------- | ||
Thu Nov 29 23:56:56 CST 2012 - [email protected] | ||
|
||
Fix a bug for ksoftirqd high cpu usage. | ||
|
||
sched: Add irq_{enter,exit}() to scheduler_ipi() | ||
|
||
- patches.taobao/sched-fix-ksoftirqd-high-usage.patch: | ||
|
||
------------------------------------------------------------------- | ||
Thu Nov 29 14:23:11 CST 2012 - [email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From: Peter Zijlstra <[email protected]> | ||
Subject: [PATCH] sched: Add irq_{enter,exit}() to scheduler_ipi() | ||
Patch-mainline: v3.0-rc7-6-gc5d753a | ||
References: | ||
|
||
Commit ID: c5d753a55ac92e09816d410cd17093813f1a904b | ||
|
||
Ensure scheduler_ipi() calls irq_{enter,exit} when it does some actual | ||
work. Traditionally we never did any actual work from the resched IPI | ||
and all magic happened in the return from interrupt path. | ||
|
||
Now that we do do some work, we need to ensure irq_{enter,exit} are | ||
called so that we don't confuse things. | ||
|
||
This affects things like timekeeping, NO_HZ and RCU, basically | ||
everything with a hook in irq_enter/exit. | ||
|
||
Explicit examples of things going wrong are: | ||
|
||
sched_clock_cpu() -- has a callback when leaving NO_HZ state to take | ||
a new reading from GTOD and TSC. Without this | ||
callback, time is stuck in the past. | ||
|
||
RCU -- needs in_irq() to work in order to avoid some nasty deadlocks | ||
|
||
Signed-off-by: Peter Zijlstra <[email protected]> | ||
Signed-off-by: Paul E. McKenney <[email protected]> | ||
Signed-off-by: Charles Wang <[email protected]> | ||
|
||
Index: linux-2.6.32-279.2.1.el5/kernel/sched.c | ||
=================================================================== | ||
--- linux-2.6.32-279.2.1.el5.orig/kernel/sched.c | ||
+++ linux-2.6.32-279.2.1.el5/kernel/sched.c | ||
@@ -2504,11 +2504,14 @@ void scheduler_ipi(void) | ||
{ | ||
if (!got_nohz_idle_kick()) | ||
return; | ||
+ | ||
+ irq_enter(); | ||
/* | ||
* Check if someone kicked us for doing the nohz idle load balance. | ||
*/ | ||
if (unlikely(got_nohz_idle_kick() && !need_resched())) | ||
raise_softirq_irqoff(SCHED_SOFTIRQ); | ||
+ irq_exit(); | ||
} | ||
|
||
/*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters