Files
kernel-tenderloin-3.0/include/linux
Peter Williams 4301065920 sched: simplify move_tasks()
The move_tasks() function is currently multiplexed with two distinct
capabilities:

1. attempt to move a specified amount of weighted load from one run
queue to another; and
2. attempt to move a specified number of tasks from one run queue to
another.

The first of these capabilities is used in two places, load_balance()
and load_balance_idle(), and in both of these cases the return value of
move_tasks() is used purely to decide if tasks/load were moved and no
notice of the actual number of tasks moved is taken.

The second capability is used in exactly one place,
active_load_balance(), to attempt to move exactly one task and, as
before, the return value is only used as an indicator of success or failure.

This multiplexing of sched_task() was introduced, by me, as part of the
smpnice patches and was motivated by the fact that the alternative, one
function to move specified load and one to move a single task, would
have led to two functions of roughly the same complexity as the old
move_tasks() (or the new balance_tasks()).  However, the new modular
design of the new CFS scheduler allows a simpler solution to be adopted
and this patch addresses that solution by:

1. adding a new function, move_one_task(), to be used by
active_load_balance(); and
2. making move_tasks() a single purpose function that tries to move a
specified weighted load and returns 1 for success and 0 for failure.

One of the consequences of these changes is that neither move_one_task()
or the new move_tasks() care how many tasks sched_class.load_balance()
moves and this enables its interface to be simplified by returning the
amount of load moved as its result and removing the load_moved pointer
from the argument list.  This helps simplify the new move_tasks() and
slightly reduces the amount of work done in each of
sched_class.load_balance()'s implementations.

Further simplification, e.g. changes to balance_tasks(), are possible
but (slightly) complicated by the special needs of load_balance_fair()
so I've left them to a later patch (if this one gets accepted).

NB Since move_tasks() gets called with two run queue locks held even
small reductions in overhead are worthwhile.

[ mingo@elte.hu ]

this change also reduces code size nicely:

   text    data     bss     dec     hex filename
   39216    3618      24   42858    a76a sched.o.before
   39173    3618      24   42815    a73f sched.o.after

Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2007-08-09 11:16:46 +02:00
..
2007-07-12 15:41:24 -07:00
2007-07-26 01:53:39 +02:00
2007-07-19 10:04:52 -07:00
2007-07-31 15:39:44 -07:00
2007-07-19 10:04:43 -07:00
2007-07-20 01:11:59 +02:00
2007-02-20 17:10:15 -08:00
2007-07-19 10:04:45 -07:00
2007-07-31 10:43:05 -05:00
2007-07-21 17:49:15 -07:00
2007-05-07 12:13:00 -07:00
2007-07-10 17:18:59 -07:00
2007-07-16 09:05:46 -07:00
2007-07-17 10:23:04 -07:00
2007-05-10 18:24:13 +02:00
2007-05-08 11:15:25 -07:00
2007-05-08 11:15:26 -07:00
2007-07-09 08:22:54 +01:00
2007-07-09 08:23:17 +01:00
2007-07-11 16:09:00 -07:00
2007-02-11 11:18:07 -08:00
2007-07-19 10:04:54 -07:00
2007-07-12 10:55:56 -07:00
2007-07-17 10:23:06 -07:00
2007-06-01 08:18:29 -07:00
2007-03-27 09:05:15 -07:00
2007-07-16 09:05:52 -07:00
2007-05-09 08:57:56 +02:00
2007-07-16 09:05:52 -07:00
2007-07-18 09:15:20 -04:00
2007-07-18 09:15:20 -04:00
2007-07-17 10:23:13 -07:00
2007-05-06 20:38:28 -04:00
2007-07-16 09:05:45 -07:00
2007-07-31 15:39:43 -07:00
2007-07-18 18:29:37 -04:00
2007-07-16 09:05:41 -07:00
2007-06-18 09:48:41 -07:00
2007-07-17 10:22:59 -07:00
2007-07-10 00:35:17 -04:00
2007-07-09 18:51:58 +02:00
2007-04-28 11:01:07 -04:00
2007-07-19 10:04:41 -07:00
2007-03-16 00:59:29 -04:00
2007-07-29 17:09:29 -07:00
2007-07-31 15:39:41 -07:00
2007-07-16 09:05:34 -07:00
2007-07-10 22:15:03 -07:00
2007-07-14 18:55:06 -07:00
2007-04-25 22:24:41 -07:00
2007-04-25 22:29:10 -07:00
2007-07-16 09:05:47 -07:00
2007-07-31 15:39:41 -07:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:47 -07:00
2007-07-31 15:39:41 -07:00
2007-04-25 22:25:52 -07:00
2007-07-18 08:47:40 -07:00
2007-07-30 14:25:12 -07:00
2007-05-09 12:30:53 -07:00
2007-07-10 22:15:26 -07:00
2007-05-03 10:52:32 +03:00
2007-07-17 10:23:03 -07:00
2007-07-17 10:23:13 -07:00
2007-07-19 10:04:49 -07:00
2007-05-18 20:46:30 -07:00
2007-07-24 12:24:59 -07:00
2007-07-16 09:05:34 -07:00
2007-07-18 08:47:45 -07:00
2007-05-08 11:15:18 -07:00
2007-05-09 12:30:49 -07:00
2007-05-03 10:52:22 +03:00
2007-07-29 17:09:29 -07:00
2007-07-31 15:39:39 -07:00
2007-07-16 09:05:42 -07:00
2007-07-19 10:04:45 -07:00
2007-07-16 09:05:51 -07:00
2007-05-09 12:30:54 -07:00
2007-07-19 15:21:39 -04:00
2007-05-04 17:59:07 -07:00
2007-07-20 13:41:56 +10:00
2007-07-20 13:10:22 +10:00
2007-05-08 11:15:05 -07:00
2007-05-08 11:15:05 -07:00
2007-05-05 14:15:32 -07:00
2007-03-12 16:31:50 -07:00
2007-05-08 11:15:14 -07:00
2007-04-17 16:36:26 -07:00
2007-07-26 11:35:21 -07:00
2007-07-26 11:35:21 -07:00
2007-05-08 11:14:57 -07:00
2007-07-16 09:05:50 -07:00
2007-07-16 09:05:46 -07:00
2007-07-17 10:23:03 -07:00
2007-05-07 12:12:54 -07:00
2007-05-09 08:57:56 +02:00
2007-07-18 08:47:40 -07:00
2007-07-21 18:37:10 -07:00
2007-06-07 13:39:34 -07:00
2007-05-17 05:23:06 -07:00
2007-05-08 11:15:18 -07:00
2007-08-09 11:16:46 +02:00
2007-07-16 09:05:50 -07:00
2007-05-07 12:12:50 -07:00
2007-07-22 11:03:37 -07:00
2007-05-11 08:29:36 -07:00
2007-07-20 12:33:44 -07:00
2007-07-20 08:24:50 -07:00
2007-02-20 17:10:14 -08:00
2007-05-21 21:47:27 -07:00
2007-07-16 09:05:45 -07:00
2007-07-16 09:05:46 -07:00
2007-07-19 10:04:49 -07:00
2007-07-16 09:05:40 -07:00
2007-05-08 11:15:18 -07:00
2007-07-18 08:47:40 -07:00
2007-05-09 12:30:57 -07:00
2007-07-17 10:22:59 -07:00
2007-02-20 17:10:13 -08:00
2007-05-11 08:29:34 -07:00
2007-07-31 15:39:39 -07:00
2007-05-11 08:29:36 -07:00
2007-07-20 11:23:02 -07:00
2007-05-11 08:29:35 -07:00
2007-05-11 08:29:35 -07:00
2007-07-16 09:05:47 -07:00
2007-05-03 00:55:34 -04:00
2007-07-18 15:57:15 -07:00
2007-05-07 12:12:58 -07:00
2007-07-30 13:27:44 -07:00
2007-07-17 10:22:59 -07:00
2007-07-09 18:52:01 +02:00
2007-05-21 09:18:19 -07:00
2007-02-11 11:18:05 -08:00
2007-05-04 12:55:39 -07:00