[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e6c390f2dfd04c165ce45b0032f73fba85b1f282@git.kernel.org>
Date: Wed, 27 Nov 2013 06:10:59 -0800
From: tip-bot for Dario Faggioli <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, pjt@...gle.com, raistlin@...ux.it,
tglx@...utronix.de, juri.lelli@...il.com
Subject: [tip:sched/core] sched: Add sched_class->task_dead() method
Commit-ID: e6c390f2dfd04c165ce45b0032f73fba85b1f282
Gitweb: http://git.kernel.org/tip/e6c390f2dfd04c165ce45b0032f73fba85b1f282
Author: Dario Faggioli <raistlin@...ux.it>
AuthorDate: Thu, 7 Nov 2013 14:43:35 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 27 Nov 2013 14:08:50 +0100
sched: Add sched_class->task_dead() method
Add a new function to the scheduling class interface. It is called
at the end of a context switch, if the prev task is in TASK_DEAD state.
It will be useful for the scheduling classes that want to be notified
when one of their tasks dies, e.g. to perform some cleanup actions,
such as SCHED_DEADLINE.
Signed-off-by: Dario Faggioli <raistlin@...ux.it>
Reviewed-by: Paul Turner <pjt@...gle.com>
Signed-off-by: Juri Lelli <juri.lelli@...il.com>
Cc: bruce.ashfield@...driver.com
Cc: claudio@...dence.eu.com
Cc: darren@...art.com
Cc: dhaval.giani@...il.com
Cc: fchecconi@...il.com
Cc: fweisbec@...il.com
Cc: harald.gustafsson@...csson.com
Cc: hgu1972@...il.com
Cc: insop.song@...il.com
Cc: jkacur@...hat.com
Cc: johan.eker@...csson.com
Cc: liming.wang@...driver.com
Cc: luca.abeni@...tn.it
Cc: michael@...rulasolutions.com
Cc: nicola.manica@...i.unitn.it
Cc: oleg@...hat.com
Cc: paulmck@...ux.vnet.ibm.com
Cc: p.faure@...tech.ch
Cc: rostedt@...dmis.org
Cc: tommaso.cucinotta@...up.it
Cc: vincent.guittot@...aro.org
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/1383831828-15501-2-git-send-email-juri.lelli@gmail.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/core.c | 3 +++
kernel/sched/sched.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 19db8f3..25b3779 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2003,6 +2003,9 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
if (unlikely(prev_state == TASK_DEAD)) {
task_numa_free(prev);
+ if (prev->sched_class->task_dead)
+ prev->sched_class->task_dead(prev);
+
/*
* Remove function-return probe instances associated with this
* task and put them back on the free list.
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 88c85b2..b3b4a49 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1023,6 +1023,7 @@ struct sched_class {
void (*set_curr_task) (struct rq *rq);
void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
void (*task_fork) (struct task_struct *p);
+ void (*task_dead) (struct task_struct *p);
void (*switched_from) (struct rq *this_rq, struct task_struct *task);
void (*switched_to) (struct rq *this_rq, struct task_struct *task);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists