Files
kernel-tenderloin-3.0/include/linux
Eric Dumazet 5517d86bea Speed up divides by cpu_power in scheduler
I noticed expensive divides done in try_to_wakeup() and
find_busiest_group() on a bi dual core Opteron machine (total of 4 cores),
moderatly loaded (15.000 context switch per second)

oprofile numbers :

CPU: AMD64 processors, speed 2600.05 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit
mask of 0x00 (No unit mask) count 50000
samples  %        symbol name
...
613914    1.0498  try_to_wake_up
    834  0.0013 :ffffffff80227ae1:   div    %rcx
77513  0.1191 :ffffffff80227ae4:   mov    %rax,%r11

608893    1.0413  find_busiest_group
   1841  0.0031 :ffffffff802260bf:       div    %rdi
140109  0.2394 :ffffffff802260c2:       test   %sil,%sil

Some of these divides can use the reciprocal divides we introduced some
time ago (currently used in slab AFAIK)

We can assume a load will fit in a 32bits number, because with a
SCHED_LOAD_SCALE=128 value, its still a theorical limit of 33554432

When/if we reach this limit one day, probably cpus will have a fast
hardware divide and we can zap the reciprocal divide trick.

Ingo suggested to rename cpu_power to __cpu_power to make clear it should
not be modified without changing its reciprocal value too.

I did not convert the divide in cpu_avg_load_per_task(), because tracking
nr_running changes may be not worth it ?  We could use a static table of 32
reciprocal values but it would add a conditional branch and table lookup.

[akpm@linux-foundation.org: !SMP build fix]
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:17 -07:00
..
2006-09-26 17:40:24 -04:00
2007-05-01 16:11:57 +02:00
2007-05-08 11:15:16 -07:00
2007-04-30 22:17:15 -07:00
2006-12-04 02:00:22 -05:00
2006-10-03 23:01:26 +02:00
2006-12-02 21:22:55 -08:00
2006-12-02 21:22:55 -08:00
2007-02-20 17:10:15 -08:00
2006-12-08 08:28:39 -08:00
2006-12-07 08:39:20 -08:00
2007-05-07 12:12:55 -07:00
2006-12-08 08:28:39 -08:00
2007-01-30 08:26:45 -08:00
2007-02-20 17:10:14 -08:00
2007-05-08 11:15:15 -07:00
2007-05-07 12:13:00 -07:00
2007-05-07 12:13:00 -07:00
2007-05-08 11:15:04 -07:00
2007-05-08 11:15:03 -07:00
2007-04-27 10:57:31 -07:00
2006-12-07 08:39:25 -08:00
2007-05-01 09:11:12 +01:00
2007-02-09 17:39:36 -05:00
2007-02-11 11:18:07 -08:00
2007-05-07 12:12:58 -07:00
2007-05-03 13:17:25 -07:00
2007-03-27 09:05:15 -07:00
2007-05-06 20:38:28 -04:00
2006-09-22 15:18:47 -07:00
2007-05-08 11:15:04 -07:00
2006-12-07 08:39:32 -08:00
2006-10-02 07:57:12 -07:00
2007-04-28 11:01:07 -04:00
2007-04-19 14:56:12 +02:00
2007-03-16 00:59:29 -04:00
2007-04-07 10:03:43 -07:00
2006-12-10 21:21:29 +01:00
2007-05-01 23:26:34 +02:00
2007-05-05 22:03:49 +02:00
2007-04-25 22:30:01 -07:00
2007-04-25 22:29:10 -07:00
2007-04-25 22:24:41 -07:00
2007-04-25 22:29:10 -07:00
2006-09-28 18:02:29 -07:00
2006-10-10 15:37:22 -07:00
2006-08-21 10:02:50 +02:00
2006-12-02 21:21:21 -08:00
2006-12-07 08:39:47 -08:00
2006-12-07 08:39:47 -08:00
2006-12-07 08:39:47 -08:00
2006-10-04 00:31:09 -07:00
2007-05-08 11:15:09 -07:00
2006-12-08 08:28:57 -08:00
2006-11-30 05:24:39 +01:00
2007-04-25 22:25:52 -07:00
2007-05-07 12:13:00 -07:00
2007-04-25 22:29:49 -07:00
2007-05-03 10:52:32 +03:00
2007-02-17 19:17:37 +01:00
2007-05-03 10:52:22 +03:00
2007-05-07 12:12:53 -07:00
2006-11-30 04:40:22 +01:00
2006-09-28 18:02:22 -07:00
2007-01-23 00:34:54 -05:00
2006-08-27 11:01:32 -07:00
2007-05-04 17:59:07 -07:00
2007-05-07 12:12:59 -07: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-03-27 08:55:47 +02:00
2007-04-17 16:36:26 -07:00
2007-04-30 16:40:41 -07:00
2007-05-08 11:15:00 -07:00
2007-05-08 11:14:57 -07:00
2006-12-04 02:00:36 -05:00
2006-10-03 23:01:26 +02:00
2007-01-11 18:18:21 -08:00
2007-05-07 12:12:54 -07:00
2007-02-11 10:51:28 -08:00
2006-09-26 08:49:04 -07:00
2006-12-22 08:55:49 -08:00
2006-12-10 09:55:40 -08:00
2006-12-07 08:39:35 -08:00
2007-05-07 12:12:58 -07:00
2007-05-07 12:12:50 -07:00
2007-05-03 03:16:20 -07:00
2007-05-07 12:12:54 -07:00
2007-02-20 17:10:14 -08:00
2007-02-20 17:10:14 -08:00
2006-10-10 16:15:34 -07:00
2007-05-08 11:14:58 -07:00
2006-10-01 00:39:18 -07:00
2007-05-07 12:12:59 -07:00
2007-02-12 09:48:41 -08:00
2007-02-11 10:51:18 -08:00
2007-02-20 17:10:13 -08:00
2006-10-11 11:14:21 -07:00
2006-11-30 05:32:19 +01:00
2007-05-08 11:15:06 -07:00
2007-05-08 11:15:05 -07:00
2007-02-16 08:13:56 -08:00
2006-12-02 21:21:08 -08:00
2007-03-05 07:57:51 -08:00
2006-09-28 17:53:59 -07:00
2006-12-15 08:47:51 -08:00
2007-05-07 12:12:58 -07:00
2006-10-01 00:39:19 -07:00
2007-02-11 10:51:25 -08:00
2007-02-11 11:18:05 -08:00
2007-05-04 12:55:39 -07:00