Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27181
b: refs/heads/master
c: 9145bcf
h: refs/heads/master
i:
  27179: ff66040
v: v3
  • Loading branch information
David S. Miller committed Jun 11, 2006
1 parent ce7919c commit 77847f1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1f4d4a7e8f5a46929a987ec17987dbbdd73029d4
refs/heads/master: 9145bcf63575a8b78590a5beaf604001e9c8d2ef
35 changes: 35 additions & 0 deletions trunk/arch/sparc64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,40 @@ int setup_profiling_timer(unsigned int multiplier)
return 0;
}

static void __init smp_tune_scheduling(void)
{
int instance, node;
unsigned int def, smallest = ~0U;

def = ((tlb_type == hypervisor) ?
(3 * 1024 * 1024) :
(4 * 1024 * 1024));

instance = 0;
while (!cpu_find_by_instance(instance, &node, NULL)) {
unsigned int val;

val = prom_getintdefault(node, "ecache-size", def);
if (val < smallest)
smallest = val;

instance++;
}

/* Any value less than 256K is nonsense. */
if (smallest < (256U * 1024U))
smallest = 256 * 1024;

max_cache_size = smallest;

if (smallest < 1U * 1024U * 1024U)
printk(KERN_INFO "Using max_cache_size of %uKB\n",
smallest / 1024U);
else
printk(KERN_INFO "Using max_cache_size of %uMB\n",
smallest / 1024U / 1024U);
}

/* Constrain the number of cpus to max_cpus. */
void __init smp_prepare_cpus(unsigned int max_cpus)
{
Expand Down Expand Up @@ -1322,6 +1356,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
}

smp_store_cpu_info(boot_cpu_id);
smp_tune_scheduling();
}

/* Set this up early so that things like the scheduler can init
Expand Down

0 comments on commit 77847f1

Please sign in to comment.