summaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
Commit message (Collapse)AuthorAgeFilesLines
* vmstat: drop the HighUse field from malloc dumpMateusz Guzik2020-11-091-5/+4
| | | | | | | | | | It is hardwired to "-" since its introduction in 2005. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27141 Notes: svn path=/head/; revision=367534
* vmstat: remove spurious newlines when reporting zonesMateusz Guzik2020-11-091-2/+1
| | | | Notes: svn path=/head/; revision=367501
* malloc: export kernel zones instead of relying on them being power-of-2Mateusz Guzik2020-11-021-4/+6
| | | | | | | | Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D27026 Notes: svn path=/head/; revision=367274
* Describe the value in the 're' column of vmstat(8) in terms of freebsd's vmIan Lepore2020-07-261-1/+1
| | | | | | | | | implementation. The old description was left over from the 4.4 BSD Lite import in 1994, and was a bit misleading (not all arches use simulated reference bits, some implement reference tracking in hardware). Notes: svn path=/head/; revision=363576
* Remove commented-out lines describing the old never-implemented -t option.Ian Lepore2020-07-261-4/+1
| | | | | | | | | | | In 2018, r338094 removed the commented-out code for supporting the -t command line option which had been present since the BSD 4.4 Lite import, but was never implemented for freebsd. This does the same for the man page. Notes: svn path=/head/; revision=363569
* Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)Gordon Bergling2020-06-181-1/+6
| | | | | | | | | | Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D25019 Notes: svn path=/head/; revision=362327
* Move type casts into a single place. No functional changes.Edward Tomasz Napierala2019-12-291-23/+15
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=356171
* Humanize more columns in the vmstat(8) output and adjust widths.Edward Tomasz Napierala2019-11-081-29/+51
| | | | | | | | | | | | The few columns that are not humanized are usually 0. This makes the output mostly aligned. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22185 Notes: svn path=/head/; revision=354533
* Fix column title alignment.Edward Tomasz Napierala2019-10-291-3/+3
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=354154
* Add two new kernel options to control memory locality on NUMA hardware.Jeff Roberson2019-08-061-4/+5
| | | | | | | | | | | | | | | | - UMA_XDOMAIN enables an additional per-cpu bucket for freed memory that was freed on a different domain from where it was allocated. This is only used for UMA_ZONE_NUMA (first-touch) zones. - UMA_FIRSTTOUCH sets the default UMA policy to be first-touch for all zones. This tries to maintain locality for kernel memory. Reviewed by: gallatin, alc, kib Tested by: pho, gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20929 Notes: svn path=/head/; revision=350659
* Provide separate accounting for user-wired pages.Mark Johnston2019-05-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Notes: svn path=/head/; revision=347532
* Dynamically allocate IRQ ranges on x86.John Baldwin2018-08-281-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, x86 used static ranges of IRQ values for different types of I/O interrupts. Interrupt pins on I/O APICs and 8259A PICs used IRQ values from 0 to 254. MSI interrupts used a compile-time-defined range starting at 256, and Xen event channels used a compile-time-defined range after MSI. Some recent systems have more than 255 I/O APIC interrupt pins which resulted in those IRQ values overflowing into the MSI range triggering an assertion failure. Replace statically assigned ranges with dynamic ranges. Do a single pass computing the sizes of the IRQ ranges (PICs, MSI, Xen) to determine the total number of IRQs required. Allocate the interrupt source and interrupt count arrays dynamically once this pass has completed. To minimize runtime complexity these arrays are only sized once during bootup. The PIC range is determined by the PICs present in the system. The MSI and Xen ranges continue to use a fixed size, though this does make it possible to turn the MSI range size into a tunable in the future. As a result, various places are updated to use dynamic limits instead of constants. In addition, the vmstat(8) utility has been taught to understand that some kernels may treat 'intrcnt' and 'intrnames' as pointers rather than arrays when extracting interrupt stats from a crashdump. This is determined by the presence (vs absence) of a global 'nintrcnt' symbol. This change reverts r189404 which worked around a buggy BIOS which enumerated an I/O APIC twice (using the same memory mapped address for both entries but using an IRQ base of 256 for one entry and a valid IRQ base for the second entry). Making the "base" of MSI IRQ values dynamic avoids the panic that r189404 worked around, and there may now be valid I/O APICs with an IRQ base above 256 which this workaround would incorrectly skip. If in the future the issue reported in PR 130483 reoccurs, we will have to add a pass over the I/O APIC entries in the MADT to detect duplicates using the memory mapped address and use some strategy to choose the "correct" one. While here, reserve room in intrcnts for the Hyper-V counters. PR: 229429, 130483 Reviewed by: kib, royger, cem Tested by: royger (Xen), kib (DMAR) Approved by: re (gjb) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16861 Notes: svn path=/head/; revision=338360
* Fully retire the unimplemented -t option from vmstat(8).John Baldwin2018-08-201-43/+2
| | | | | | | | | | | | It was #ifdef'd out in the 4.4BSD import and hasn't been re-enabled since then. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16804 Notes: svn path=/head/; revision=338094
* vmstat(1): various nitsEitan Adler2018-06-132-7/+10
| | | | | | | | | | | Continue my parade on introspection tools by fixing: - failed to check for null after reallocf - avoid the comma operator - mark usage as dead - correct size of len Notes: svn path=/head/; revision=335036
* Temporarily widen count for interrupt rate calculations on 32-bit archsJustin Hibbits2018-02-081-1/+1
| | | | | | | | | | | | | If the interrupt count is very high (greater than ~42M), notably on one-shot execution on long running systems, the intermediate multiplication step in the rate calculation will overflow the width of a 32-bit architecture long (32 bits), causing the rest of the calculation to calculate with a truncated value, and report very low rates (sometimes 0). MFC after: 2 weeks Notes: svn path=/head/; revision=329013
* Update various statements in vmstat(8) to match reality.John Baldwin2018-01-181-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Reported by: mwlucas (indirectly) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13905 Notes: svn path=/head/; revision=328134
* vmstat(8): Hook up NetBSD testsKyle Evans2018-01-112-0/+14
| | | | | | | | | The NetBSD tests for vmstat are basically just a smoke test, ensuring that executing `vmstat` and `vmstat -s` exit successfully. This is more than we test now, so go with it. Notes: svn path=/head/; revision=327832
* Re-add spaces lost in r326436.Mark Johnston2017-12-141-4/+4
| | | | | | | X-MFC with: r326436 Notes: svn path=/head/; revision=326852
* vmstat: fix style(9) violations and bump WARNS.Konstantin Belousov2017-12-012-263/+218
| | | | | | | | | | | Based on the patch by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. (Pawel), The FreeBSD Foundation (me) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13228 Notes: svn path=/head/; revision=326436
* vmstat: use 64-bit counters from struct vmtotal.Konstantin Belousov2017-11-231-6/+6
| | | | | | | | | | | Consistently print counters using unsigned intmax type. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. Differential revision: https://reviews.freebsd.org/D13199 Notes: svn path=/head/; revision=326139
* Use C standard spelling uint64_t for u_int64_t.Konstantin Belousov2017-11-231-3/+3
| | | | | | | | | Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Sponsored by: Mysterious Code Ltd. X-Differential revision: https://reviews.freebsd.org/D13199 Notes: svn path=/head/; revision=326138
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* vmstat: fix duplicate key in libxo outputAllan Jude2017-11-111-1/+1
| | | | | | | | | | | | | | In the libxo output from vmstat, the number of pages that have been paged out uses the same key name as the number of times pages have been paged. Appears to have been a typo or copy-pasto. PR: 222198 Submitted by: Yavuz Tanriverdi <stemix@gmail.com> Reviewed by: phil, garga Differential Revision: https://reviews.freebsd.org/D12395 Notes: svn path=/head/; revision=325715
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* vmstat: Always emit a space after the free-memory columnEmmanuel Vadot2017-08-081-0/+1
| | | | | | | | | | | | When displaying in non-human form, if the free-memory number is large (more than 7 digits), there is no space between it and the page fault column. PR: 221290 Submitted by: Josuah Demangeon <mail@josuah.net> (Original version) Notes: svn path=/head/; revision=322252
* Let vmstat -o recognize OBJT_MGTDEVICE objects.Mark Johnston2017-05-231-0/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=318713
* - When reading VM stats, provide proper size argument to sysctl.Gleb Smirnoff2017-04-211-17/+16
| | | | | | | - While here, remove unused arguments from mysysctl(). Notes: svn path=/head/; revision=317234
* - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeterGleb Smirnoff2017-04-171-82/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Bring back the cast removed in my previous commit to allow us build vmstatMarcelo Araujo2017-03-111-2/+2
| | | | | | | | | | with WARNS 2. This cast was first introduced at r87690. Reported by: bde, pfg and ngie MFC after: 3 weeks. Notes: svn path=/head/; revision=315049
* Use nitems() from sys/param.h and also remove the cast.Marcelo Araujo2017-03-101-6/+2
| | | | | | | | | Reviewed by: markj MFC after: 3 weeks. Differential Revision: https://reviews.freebsd.org/D9937 Notes: svn path=/head/; revision=314989
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Remove a lingering reference to cache pages from vmstat(8).Mark Johnston2016-11-161-2/+0
| | | | | | | Reported by: alc Notes: svn path=/head/; revision=308706
* Add the laundry page count to the displays of systat, top, and vmstat.Mark Johnston2016-11-101-5/+7
| | | | | | | | Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D8467 Notes: svn path=/head/; revision=308489
* Use MIN() macro from sys/param.h.Marcelo Araujo2016-04-221-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298444
* Remove extraneous charactersCraig Rodrigues2015-12-231-2/+2
| | | | | | | | Noticed by: markj Reviewed by: allanjude Notes: svn path=/head/; revision=292646
* Some problems were introduced during the libxo-ification of vmstat, fix themAllan Jude2015-12-011-7/+17
| | | | | | | | | | | | | | | | | | | | | stop vmstat -i segfaulting remove duplicate header from vmstat -i do not pad the name of the interupt in encoded outputs fix stray % and missing } in the header for vmstat -i add outer container to vmstat -i add missing xo_flush in vmstat -i (when run with an interval or delay) add outer container to vmstat -m do not pad the name of malloc areans add outer container to vmstat -z do not pad the name of memory zones Reviewed by: rodrigc Approved by: bapt (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4263 Notes: svn path=/head/; revision=291595
* Update dependencies after r291406 added libelf to libkvm.Bryan Drewery2015-12-011-0/+2
| | | | | | | | | | | Unfortunately filemon/meta mode tracks all indirect dependencies here since ld(1) is reading libelf when linking in libkvm. Churn would be reduced if this was able to be limited to direct dependencies. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291558
* Add a missing brace to fix vmstat -s output.Mark Johnston2015-11-211-1/+1
| | | | Notes: svn path=/head/; revision=291148
* Convert vmstat to use libxo.Craig Rodrigues2015-11-203-193/+339
| | | | | | | | | | | | | | This patch was based on this patch: https://github.com/Juniper/libxo/blob/master/patches/vmstat.patch by Phil Shafer at Juniper Networks, but updated to the latest vmstat code. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D3935 Notes: svn path=/head/; revision=291090
* Remove the v_cache_min and v_cache_max sysctls. They are unused and haveMark Johnston2015-09-111-2/+0
| | | | | | | | | | no effect. Reviewed by: alc Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=287640
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-42/+114
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=283595
| * \ Merge from head@274682Simon J. Gerraty2014-11-192-37/+70
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ \ Merge head from 7/28Simon J. Gerraty2014-08-191-1/+11
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync with HEAD.David E. O'Brien2013-02-081-0/+3
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555