summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-05-13 15:40:51 +0000
committerattilio <attilio@FreeBSD.org>2013-05-13 15:40:51 +0000
commit291f413ed8d0dec9c88fc58da7a31334ad3c09cd (patch)
treef5e951fdd104c25d0807d6e05ce05e3ff0c03bde /sys/x86
parent3ab4b4db19663ed22fdaf264f9401d1d2a38371d (diff)
downloadFreeBSD-src-291f413ed8d0dec9c88fc58da7a31334ad3c09cd.zip
FreeBSD-src-291f413ed8d0dec9c88fc58da7a31334ad3c09cd.tar.gz
o Add accessor functions to add and remove pages from a specific
freelist. o Split the pool of free pages queues really by domain and not rely on definition of VM_RAW_NFREELIST. o For MAXMEMDOM > 1, wrap the RR allocation logic into a specific function that is called when calculating the allocation domain. The RR counter is kept, currently, per-thread. In the future it is expected that such function evolves in a real policy decision referee, based on specific informations retrieved by per-thread and per-vm_object attributes. o Add the concept of "probed domains" under the form of vm_ndomains. It is responsibility for every architecture willing to support multiple memory domains to correctly probe vm_ndomains along with mem_affinity segments attributes. Those two values are supposed to remain always consistent. Please also note that vm_ndomains and td_dom_rr_idx are both int because segments already store domains as int. Ideally u_int would have much more sense. Probabilly this should be cleaned up in the future. o Apply RR domain selection also to vm_phys_zero_pages_idle(). Sponsored by: EMC / Isilon storage division Partly obtained from: jeff Reviewed by: alc Tested by: jeff
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/acpica/srat.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/x86/acpica/srat.c b/sys/x86/acpica/srat.c
index 8737688..7ea715e 100644
--- a/sys/x86/acpica/srat.c
+++ b/sys/x86/acpica/srat.c
@@ -244,33 +244,34 @@ static int
renumber_domains(void)
{
int domains[VM_PHYSSEG_MAX];
- int ndomain, i, j, slot;
+ int i, j, slot;
/* Enumerate all the domains. */
- ndomain = 0;
+ vm_ndomains = 0;
for (i = 0; i < num_mem; i++) {
/* See if this domain is already known. */
- for (j = 0; j < ndomain; j++) {
+ for (j = 0; j < vm_ndomains; j++) {
if (domains[j] >= mem_info[i].domain)
break;
}
- if (j < ndomain && domains[j] == mem_info[i].domain)
+ if (j < vm_ndomains && domains[j] == mem_info[i].domain)
continue;
/* Insert the new domain at slot 'j'. */
slot = j;
- for (j = ndomain; j > slot; j--)
+ for (j = vm_ndomains; j > slot; j--)
domains[j] = domains[j - 1];
domains[slot] = mem_info[i].domain;
- ndomain++;
- if (ndomain > MAXMEMDOM) {
+ vm_ndomains++;
+ if (vm_ndomains > MAXMEMDOM) {
+ vm_ndomains = 1;
printf("SRAT: Too many memory domains\n");
return (EFBIG);
}
}
/* Renumber each domain to its index in the sorted 'domains' list. */
- for (i = 0; i < ndomain; i++) {
+ for (i = 0; i < vm_ndomains; i++) {
/*
* If the domain is already the right value, no need
* to renumber.
@@ -286,6 +287,9 @@ renumber_domains(void)
if (cpus[j].enabled && cpus[j].domain == domains[i])
cpus[j].domain = i;
}
+ KASSERT(vm_ndomains > 0,
+ ("renumber_domains: invalid final vm_ndomains setup"));
+
return (0);
}
OpenPOWER on IntegriCloud