lkml.org 
[lkml]   [2009]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 04/21] sched: implement scheduler notifiers
    From
    Date
    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.


    \
     
     \ /
      Last update: 2009-11-16 19:43    [W:4.195 / U:1.300 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site