2012-06-26 06:28:34 +00:00
|
|
|
From fc0e323ce062c258ce7a7d0eca1a6a0570b1f168 Mon Sep 17 00:00:00 2001
|
2011-11-20 00:01:55 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Date: Thu, 21 Jul 2011 21:06:43 +0200
|
2012-06-26 06:28:34 +00:00
|
|
|
Subject: [166/256] softirq-make-fifo.patch
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
---
|
|
|
|
kernel/softirq.c | 19 +++++++++++++++++++
|
|
|
|
1 file changed, 19 insertions(+)
|
|
|
|
|
2012-06-17 19:52:06 +00:00
|
|
|
diff --git a/kernel/softirq.c b/kernel/softirq.c
|
|
|
|
index d1fdb91..86561c0 100644
|
|
|
|
--- a/kernel/softirq.c
|
|
|
|
+++ b/kernel/softirq.c
|
2011-11-20 00:01:55 +00:00
|
|
|
@@ -372,6 +372,8 @@ asmlinkage void do_softirq(void)
|
|
|
|
|
|
|
|
static inline void local_bh_disable_nort(void) { local_bh_disable(); }
|
|
|
|
static inline void _local_bh_enable_nort(void) { _local_bh_enable(); }
|
|
|
|
+static inline void ksoftirqd_set_sched_params(void) { }
|
|
|
|
+static inline void ksoftirqd_clr_sched_params(void) { }
|
|
|
|
|
|
|
|
#else /* !PREEMPT_RT_FULL */
|
|
|
|
|
2012-02-08 21:25:53 +00:00
|
|
|
@@ -526,6 +528,20 @@ static int ksoftirqd_do_softirq(int cpu)
|
2011-11-20 00:01:55 +00:00
|
|
|
static inline void local_bh_disable_nort(void) { }
|
|
|
|
static inline void _local_bh_enable_nort(void) { }
|
|
|
|
|
|
|
|
+static inline void ksoftirqd_set_sched_params(void)
|
|
|
|
+{
|
|
|
|
+ struct sched_param param = { .sched_priority = 1 };
|
|
|
|
+
|
|
|
|
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void ksoftirqd_clr_sched_params(void)
|
|
|
|
+{
|
|
|
|
+ struct sched_param param = { .sched_priority = 0 };
|
|
|
|
+
|
|
|
|
+ sched_setscheduler(current, SCHED_NORMAL, ¶m);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
#endif /* PREEMPT_RT_FULL */
|
|
|
|
/*
|
|
|
|
* Enter an interrupt context.
|
2012-06-04 21:20:09 +00:00
|
|
|
@@ -977,6 +993,8 @@ void __init softirq_init(void)
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
static int run_ksoftirqd(void * __bind_cpu)
|
|
|
|
{
|
|
|
|
+ ksoftirqd_set_sched_params();
|
|
|
|
+
|
|
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
|
|
|
|
|
|
while (!kthread_should_stop()) {
|
2012-06-17 19:52:06 +00:00
|
|
|
@@ -1002,6 +1020,7 @@ static int run_ksoftirqd(void * __bind_cpu)
|
2011-11-20 00:01:55 +00:00
|
|
|
|
|
|
|
wait_to_die:
|
|
|
|
preempt_enable();
|
|
|
|
+ ksoftirqd_clr_sched_params();
|
|
|
|
/* Wait for kthread_stop */
|
|
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
|
|
while (!kthread_should_stop()) {
|