Re: [PATCH] sched: minor optimization



On 24/11/2007, Nikanth Karthikesan <knikanth@xxxxxxx> wrote:
As an optimization, if all tasks are in the fair class, the next task is
directly picked from fair_sched_class. But, if it returns no task we go
through again from sched_class_highest which could be avoided and
instead return the idle task directly.

The only legitimate possibility of having the fair_sched_class
returning no task in this case is when 'rq->nr_running ==
rq->cfs.nr_running == 0'.

iow, a possible optimization would be just the following check :

if (rq->nr_running == 0)
return idle_sched_class.pick_next_task(rq);

at the beginning of pick_next_task().

(or maybe put it at the beginning of the
if (likely(rq->nr_running == rq->cfs.nr_running)) {} block as we
already have 'likely()' there).


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



Relevant Pages

  • The ATN TP4/CLNP Networking Suite for GNU Linux systems
    ... Please put me in the CC when replying since I am not in the mailing list. ... Best regards, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: The ATN TP4/CLNP Networking Suite for GNU Linux systems
    ... Eus wrote: ... Best regards, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [patch 00/23] 2.6.22-stable review
    ... several of my machines. ... Best regards, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Kernelsources writeable for everyone?!
    ... coffee src # tar -jtvf linux-2.6.17.1.tar.bz2 ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Software RAID (non-preempt) server blocking question. (2.6.20.4)
    ... I do use the following optimization, perhaps a bad idea if I want other ... echo "Setting minimum resync speed to 200MB/s..." ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)