diff options
| author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-11 01:02:17 -0400 |
|---|---|---|
| committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-11 01:02:17 -0400 |
| commit | 9145bcf63575a8b78590a5beaf604001e9c8d2ef (patch) | |
| tree | 386b8c3cdea8cb0d3909e6bf7f30750ae0864ac6 /arch/sparc64 | |
| parent | 1f4d4a7e8f5a46929a987ec17987dbbdd73029d4 (diff) | |
[SPARC64]: Set appropriate max_cache_size.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
| -rw-r--r-- | arch/sparc64/kernel/smp.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 4e8cd79156e0..f03d52d0b88d 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
| @@ -1287,6 +1287,40 @@ int setup_profiling_timer(unsigned int multiplier) | |||
| 1287 | return 0; | 1287 | return 0; |
| 1288 | } | 1288 | } |
| 1289 | 1289 | ||
| 1290 | static void __init smp_tune_scheduling(void) | ||
| 1291 | { | ||
| 1292 | int instance, node; | ||
| 1293 | unsigned int def, smallest = ~0U; | ||
| 1294 | |||
| 1295 | def = ((tlb_type == hypervisor) ? | ||
| 1296 | (3 * 1024 * 1024) : | ||
| 1297 | (4 * 1024 * 1024)); | ||
| 1298 | |||
| 1299 | instance = 0; | ||
| 1300 | while (!cpu_find_by_instance(instance, &node, NULL)) { | ||
| 1301 | unsigned int val; | ||
| 1302 | |||
| 1303 | val = prom_getintdefault(node, "ecache-size", def); | ||
| 1304 | if (val < smallest) | ||
| 1305 | smallest = val; | ||
| 1306 | |||
| 1307 | instance++; | ||
| 1308 | } | ||
| 1309 | |||
| 1310 | /* Any value less than 256K is nonsense. */ | ||
| 1311 | if (smallest < (256U * 1024U)) | ||
| 1312 | smallest = 256 * 1024; | ||
| 1313 | |||
| 1314 | max_cache_size = smallest; | ||
| 1315 | |||
| 1316 | if (smallest < 1U * 1024U * 1024U) | ||
| 1317 | printk(KERN_INFO "Using max_cache_size of %uKB\n", | ||
| 1318 | smallest / 1024U); | ||
| 1319 | else | ||
| 1320 | printk(KERN_INFO "Using max_cache_size of %uMB\n", | ||
| 1321 | smallest / 1024U / 1024U); | ||
| 1322 | } | ||
| 1323 | |||
| 1290 | /* Constrain the number of cpus to max_cpus. */ | 1324 | /* Constrain the number of cpus to max_cpus. */ |
| 1291 | void __init smp_prepare_cpus(unsigned int max_cpus) | 1325 | void __init smp_prepare_cpus(unsigned int max_cpus) |
| 1292 | { | 1326 | { |
| @@ -1322,6 +1356,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 1322 | } | 1356 | } |
| 1323 | 1357 | ||
| 1324 | smp_store_cpu_info(boot_cpu_id); | 1358 | smp_store_cpu_info(boot_cpu_id); |
| 1359 | smp_tune_scheduling(); | ||
| 1325 | } | 1360 | } |
| 1326 | 1361 | ||
| 1327 | /* Set this up early so that things like the scheduler can init | 1362 | /* Set this up early so that things like the scheduler can init |
