path: root/sys/sys/pcpu.h
diff options
authorGleb Smirnoff <glebius@FreeBSD.org>2017-04-17 17:34:47 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-04-17 17:34:47 +0000
commit83c9dea1bac40c7c7cbde4ccb3d747134311ab5a (patch)
tree7679e220e254a60031cd36e1421cb9c844a72521 /sys/sys/pcpu.h
parent21d5d37ba4c0131d6c141695366e266e32cc3bc1 (diff)
- Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter
in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to counter(9). - Since some vmmeter stats may be touched at very early stages of boot, before we have set up UMA and we can do counter_u64_alloc(), provide an early counter mechanism: o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, so that at early stages of boot, before counters are allocated we already point to a counter that can be safely written to. o For sparc64 that required a whole dummy pcpu[MAXCPU] array. Further related changes: - Don't include vmmeter.h into pcpu.h. - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, to match kernel representation. - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. This is based on benno@'s 4-year old patch: https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html Reviewed by: kib, gallatin, marius, lidl Differential Revision: https://reviews.freebsd.org/D10156
Notes: svn path=/head/; revision=317061
Diffstat (limited to 'sys/sys/pcpu.h')
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index 4c92a00c8444..41756a84eddc 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -43,7 +43,6 @@
#include <sys/_sx.h>
#include <sys/queue.h>
#include <sys/_rmlock.h>
-#include <sys/vmmeter.h>
#include <sys/resource.h>
#include <machine/pcpu.h>
@@ -158,7 +157,6 @@ struct pcpu {
u_int pc_cpuid; /* This cpu number */
STAILQ_ENTRY(pcpu) pc_allcpu;
struct lock_list_entry *pc_spinlocks;
- struct vmmeter pc_cnt; /* VM stats counters */
long pc_cp_time[CPUSTATES]; /* statclock ticks */
struct device *pc_device;
void *pc_netisr; /* netisr SWI cookie */
@@ -166,6 +164,7 @@ struct pcpu {
int pc_domain; /* Memory domain. */
struct rm_queue pc_rm_queue; /* rmlock list of trackers */
uintptr_t pc_dynamic; /* Dynamic per-cpu data area */
+ uint64_t pc_early_dummy_counter; /* Startup time counter(9) */
* Keep MD fields last, so that CPU-specific variations on a