[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1258396864.4372.55.camel@twins>
Date: Mon, 16 Nov 2009 19:41:04 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Tejun Heo <tj@...nel.org>
Cc: linux-kernel@...r.kernel.org, jeff@...zik.org, mingo@...e.hu,
akpm@...ux-foundation.org, jens.axboe@...cle.com,
rusty@...tcorp.com.au, cl@...ux-foundation.org,
dhowells@...hat.com, arjan@...ux.intel.com,
torvalds@...ux-foundation.org, avi@...hat.com, andi@...stfloor.org,
fweisbec@...il.com
Subject: Re: [PATCH 04/21] sched: implement scheduler notifiers
On Tue, 2009-11-17 at 02:15 +0900, Tejun Heo wrote:
> @@ -1939,6 +1953,8 @@ static int effective_prio(struct task_struct *p)
> */
> static void activate_task(struct rq *rq, struct task_struct *p, int wakeup)
> {
> + sched_notifier_call(p, SCHED_NOTIFIER_ACTIVATED, activated, wakeup);
> +
> if (task_contributes_to_load(p))
> rq->nr_uninterruptible--;
>
> @@ -1951,6 +1967,8 @@ static void activate_task(struct rq *rq, struct task_struct *p, int wakeup)
> */
> static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep)
> {
> + sched_notifier_call(p, SCHED_NOTIFIER_DEACTIVATED, deactivated, sleep);
> +
> if (task_contributes_to_load(p))
> rq->nr_uninterruptible++;
>
I really hate exposing activate/deactivate.
You say:
> Activated and deactivated are called
> when a task's readiness to run changes.
How is that not clear from the out hook? It would seem to me that when
you get scheduled out with a p->state != TASK_RUNNING you're not ready.
--
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