summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-03-22 10:26:09 +0000
committerbdrewery <bdrewery@FreeBSD.org>2014-03-22 10:26:09 +0000
commit6fcf6199a4a9aefe9f2e59d947f0e0df171367b5 (patch)
tree9a9561ab626d2c7b17fbd98a498de2fac743ab08 /sys/i386
parente97a0e252b398acead00694bf1d357d9089128ad (diff)
downloadFreeBSD-src-6fcf6199a4a9aefe9f2e59d947f0e0df171367b5.zip
FreeBSD-src-6fcf6199a4a9aefe9f2e59d947f0e0df171367b5.tar.gz
Rename global cnt to vm_cnt to avoid shadowing.
To reduce the diff struct pcu.cnt field was not renamed, so PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in kvm(3) and vmstat(8). The goal was to not affect externally used KPI. Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the the global cnt variable. Exp-run revealed no ports using it directly. No objection from: arch@ Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/machdep.c6
-rw-r--r--sys/i386/i386/pmap.c12
-rw-r--r--sys/i386/xen/pmap.c8
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 02f1c59..3d92e6e 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -308,7 +308,7 @@ cpu_startup(dummy)
memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10;
freeenv(sysenv);
}
- if (memsize < ptoa((uintmax_t)cnt.v_free_count))
+ if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count))
memsize = ptoa((uintmax_t)Maxmem);
printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20);
realmem = atop(memsize);
@@ -335,8 +335,8 @@ cpu_startup(dummy)
vm_ksubmap_init(&kmi);
printf("avail memory = %ju (%ju MB)\n",
- ptoa((uintmax_t)cnt.v_free_count),
- ptoa((uintmax_t)cnt.v_free_count) / 1048576);
+ ptoa((uintmax_t)vm_cnt.v_free_count),
+ ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576);
/*
* Set up buffers, so they can be used to read disk labels.
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 2605f60..e925177 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -744,7 +744,7 @@ pmap_init(void)
* numbers of pv entries.
*/
TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
- pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+ pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count;
TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
pv_entry_max = roundup(pv_entry_max, _NPCPV);
pv_entry_high_water = 9 * (pv_entry_max / 10);
@@ -1674,7 +1674,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spglist *free)
* the page table page is globally performed before TLB shoot-
* down is begun.
*/
- atomic_subtract_rel_int(&cnt.v_wire_count, 1);
+ atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1);
/*
* Do an invltlb to make the invalidated mapping
@@ -2050,7 +2050,7 @@ pmap_release(pmap_t pmap)
("pmap_release: got wrong ptd page"));
#endif
m->wire_count--;
- atomic_subtract_int(&cnt.v_wire_count, 1);
+ atomic_subtract_int(&vm_cnt.v_wire_count, 1);
vm_page_free_zero(m);
}
}
@@ -2313,7 +2313,7 @@ out:
SLIST_REMOVE_HEAD(&free, plinks.s.ss);
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
- atomic_add_int(&cnt.v_wire_count, 1);
+ atomic_add_int(&vm_cnt.v_wire_count, 1);
}
pmap_free_zero_pages(&free);
return (m_pc);
@@ -2862,7 +2862,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva,
("pmap_remove_pde: pte page wire count error"));
mpte->wire_count = 0;
pmap_add_delayed_free_list(mpte, free, FALSE);
- atomic_subtract_int(&cnt.v_wire_count, 1);
+ atomic_subtract_int(&vm_cnt.v_wire_count, 1);
}
}
}
@@ -4523,7 +4523,7 @@ pmap_remove_pages(pmap_t pmap)
("pmap_remove_pages: pte page wire count error"));
mpte->wire_count = 0;
pmap_add_delayed_free_list(mpte, &free, FALSE);
- atomic_subtract_int(&cnt.v_wire_count, 1);
+ atomic_subtract_int(&vm_cnt.v_wire_count, 1);
}
} else {
pmap->pm_stats.resident_count--;
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index fa9bda8..ece4857 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -614,7 +614,7 @@ pmap_init(void)
* numbers of pv entries.
*/
TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
- pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+ pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count;
TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
pv_entry_max = roundup(pv_entry_max, _NPCPV);
pv_entry_high_water = 9 * (pv_entry_max / 10);
@@ -1380,7 +1380,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free)
* the page table page is globally performed before TLB shoot-
* down is begun.
*/
- atomic_subtract_rel_int(&cnt.v_wire_count, 1);
+ atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1);
/*
* Do an invltlb to make the invalidated mapping
@@ -1813,7 +1813,7 @@ pmap_release(pmap_t pmap)
("pmap_release: got wrong ptd page"));
#endif
m->wire_count--;
- atomic_subtract_int(&cnt.v_wire_count, 1);
+ atomic_subtract_int(&vm_cnt.v_wire_count, 1);
vm_page_free(m);
}
#ifdef PAE
@@ -2089,7 +2089,7 @@ out:
free = (void *)m_pc->object;
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
- atomic_add_int(&cnt.v_wire_count, 1);
+ atomic_add_int(&vm_cnt.v_wire_count, 1);
}
pmap_free_zero_pages(free);
return (m_pc);
OpenPOWER on IntegriCloud