diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2017-11-15 13:41:03 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-11-15 13:41:03 +0000 |
commit | 1c778d91b5e506fc4fe93e008f464dd62e039e21 (patch) | |
tree | d21cf0f134e42f02335f2ed069ed62274b683e66 /sys/sys/vmmeter.h | |
parent | c07d14deb549f76ef59dd1085ca73c38537ea73e (diff) | |
download | src-1c778d91b5e506fc4fe93e008f464dd62e039e21.tar.gz src-1c778d91b5e506fc4fe93e008f464dd62e039e21.zip |
vmtotal: extend memory counters to accomodate for current and future
hardware sizes.
32bit counters already overflow on approachable virtual memory page
counts, and soon would overflow on the physical pages counts as well.
Bump sizes to 64bit types. Bump __FreeBSD_version.
It is impossible to provide perfect backward ABI compat for this
change. If a program requests an old structure, it can be detected by
size. But if it queries the size first by passing NULL old req
pointer, there is almost nothing we can do to detect the desired ABI.
As a partial solution, check p_osrel of the quering process when
selecting the size to report.
Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Differential revision: https://reviews.freebsd.org/D13018
Notes
Notes:
svn path=/head/; revision=325852
Diffstat (limited to 'sys/sys/vmmeter.h')
-rw-r--r-- | sys/sys/vmmeter.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index 62106ee7e989..0c94b9d18eb6 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -41,20 +41,23 @@ /* Systemwide totals computed every five seconds. */ struct vmtotal { - int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ - int32_t t_vm; /* total virtual memory */ - int32_t t_avm; /* active virtual memory */ - int32_t t_rm; /* total real memory in use */ - int32_t t_arm; /* active real memory */ - int32_t t_vmshr; /* shared virtual memory */ - int32_t t_avmshr; /* active shared virtual memory */ - int32_t t_rmshr; /* shared real memory */ - int32_t t_armshr; /* active shared real memory */ - int32_t t_free; /* free memory pages */ + uint64_t t_vm; /* total virtual memory */ + uint64_t t_avm; /* active virtual memory */ + uint64_t t_rm; /* total real memory in use */ + uint64_t t_arm; /* active real memory */ + uint64_t t_vmshr; /* shared virtual memory */ + uint64_t t_avmshr; /* active shared virtual memory */ + uint64_t t_rmshr; /* shared real memory */ + uint64_t t_armshr; /* active shared real memory */ + uint64_t t_free; /* free memory pages */ + int16_t t_rq; /* length of the run queue */ + int16_t t_dw; /* jobs in ``disk wait'' (neg + priority) */ + int16_t t_pw; /* jobs in page wait */ + int16_t t_sl; /* jobs sleeping in core */ + int16_t t_sw; /* swapped out runnable/short + block jobs */ + uint16_t t_pad[3]; }; #if defined(_KERNEL) || defined(_WANT_VMMETER) |