lkml.org 
[lkml]   [2004]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] add requeue task
    Nick Piggin writes:
    > Con Kolivas wrote:
    > > add requeue task
    > >
    > >
    > >
    > > ------------------------------------------------------------------------
    > >
    > > We can requeue tasks for cheaper then doing a complete dequeue followed by
    > > an enqueue. Add the requeue_task function and perform it where possible.
    > >
    > > Change the granularity code to requeue tasks at their best priority
    > > instead of changing priority while they're running. This keeps tasks at
    > > their top interactive level during their whole timeslice.
    > >
    >
    > I wonder... these things are all in sufficiently rarely used places,
    > that the icache miss might be more costly than the operations saved.
    >
    > But....
    >
    > > Signed-off-by: Con Kolivas <kernel@kolivas.org>
    > >
    > > Index: linux-2.6.10-rc1-mm2/kernel/sched.c
    > > ===================================================================
    > > --- linux-2.6.10-rc1-mm2.orig/kernel/sched.c 2004-11-02 14:48:54.686316718 +1100
    > > +++ linux-2.6.10-rc1-mm2/kernel/sched.c 2004-11-02 14:52:51.805763544 +1100
    > > @@ -579,6 +579,16 @@ static void enqueue_task(struct task_str
    > > }
    > >
    > > /*
    > > + * Put task to the end of the run list without the overhead of dequeue
    > > + * followed by enqueue.
    > > + */
    > > +static void requeue_task(struct task_struct *p, prio_array_t *array)
    > > +{
    > > + list_del(&p->run_list);
    > > + list_add_tail(&p->run_list, array->queue + p->prio);
    > > +}

    Shouldn't this be

    list_move_tail(&p->run_list, array->queue + p->prio);

    ?

    Nikita.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:07    [W:0.024 / U:32.444 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site