summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-09-03 17:28:30 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2016-09-03 17:28:30 -0400
commit38e40ecf914a7683ad03c2c611f4889ce691bfea (patch)
treec374a2fad430147fb2f9318f50a15893934786c6
parent36bc8c231f1512cb69b941baac68b357284ca702 (diff)
download4.8-rt-patches-38e40ecf914a7683ad03c2c611f4889ce691bfea.tar.gz
rcu: task struct refresh ; trivial refreshrt-v4.7-1266-gcca08cd66ce6
-rw-r--r--patches/sched-delay-put-task.patch28
1 files changed, 16 insertions, 12 deletions
diff --git a/patches/sched-delay-put-task.patch b/patches/sched-delay-put-task.patch
index eb42239a7335c..a10c438d29bd3 100644
--- a/patches/sched-delay-put-task.patch
+++ b/patches/sched-delay-put-task.patch
@@ -1,19 +1,18 @@
-Subject: sched: Move task_struct cleanup to RCU
+From 0916016697817bc316440bc42062ee6aeb2ba8a1 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 31 May 2011 16:59:16 +0200
+Subject: [PATCH] sched: Move task_struct cleanup to RCU
__put_task_struct() does quite some expensive work. We don't want to
burden random tasks with that.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
----
- include/linux/sched.h | 13 +++++++++++++
- kernel/fork.c | 15 ++++++++++++++-
- 2 files changed, 27 insertions(+), 1 deletion(-)
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index 2028d3fba470..74994e849280 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -1865,6 +1865,9 @@ struct task_struct {
+@@ -1932,6 +1932,9 @@ struct task_struct {
unsigned int sequential_io;
unsigned int sequential_io_avg;
#endif
@@ -23,7 +22,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
unsigned long task_state_change;
#endif
-@@ -2077,6 +2080,15 @@ extern struct pid *cad_pid;
+@@ -2144,6 +2147,15 @@ extern struct pid *cad_pid;
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
@@ -39,17 +38,19 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
extern void __put_task_struct(struct task_struct *t);
static inline void put_task_struct(struct task_struct *t)
-@@ -2084,6 +2096,7 @@ static inline void put_task_struct(struc
+@@ -2151,6 +2163,7 @@ static inline void put_task_struct(struct task_struct *t)
if (atomic_dec_and_test(&t->usage))
__put_task_struct(t);
}
+#endif
- #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
- extern void task_cputime(struct task_struct *t,
+ struct task_struct *task_rcu_dereference(struct task_struct **ptask);
+ struct task_struct *try_get_task_struct(struct task_struct **ptask);
+diff --git a/kernel/fork.c b/kernel/fork.c
+index f5b0568ef142..076d00b402c4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -253,7 +253,9 @@ static inline void put_signal_struct(str
+@@ -253,7 +253,9 @@ static inline void put_signal_struct(struct signal_struct *sig)
if (atomic_dec_and_test(&sig->sigcnt))
free_signal_struct(sig);
}
@@ -60,7 +61,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
void __put_task_struct(struct task_struct *tsk)
{
WARN_ON(!tsk->exit_state);
-@@ -270,7 +272,18 @@ void __put_task_struct(struct task_struc
+@@ -270,7 +272,18 @@ void __put_task_struct(struct task_struct *tsk)
if (!profile_handoff_task(tsk))
free_task(tsk);
}
@@ -79,3 +80,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
void __init __weak arch_task_cache_init(void) { }
+--
+2.5.0
+