aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/zone.9
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit fa9896e082a1)
* uma: Add UMA_ZONE_UNMANAGEDHans Petter Selasky2022-02-241-1/+7
| | | | | | | | | | | | | | | Allow a zone to opt out of cache size management. In particular, uma_reclaim() and uma_reclaim_domain() will not reclaim any memory from the zone, nor will uma_timeout() purge cached items if the zone is idle. This effectively means that the zone consumer has control over when items are reclaimed from the cache. In particular, uma_zone_reclaim() will still reclaim cached items from an unmanaged zone. Reviewed by: hselasky, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34142 (cherry picked from commit 389a3fa693ef61c35e15b36f042fb24197b7afb1)
* zone.9: Remove documentation of non-existent NUMA configuration flagsMark Johnston2022-01-211-20/+0
| | | | | | | | | | | These configuration options were removed in commit dfe13344f557. Some forthcoming work will update the UMA man page to describe its current behaviour on NUMA systems. Sponsored by: The FreeBSD Foundation (cherry picked from commit 39d4ccf82607c99655fda0d76357a7f534fa724f)
* uma: Introduce per-domain reclamation functionsMark Johnston2021-04-281-1/+13
| | | | | | | | | | | | | | | | | | | | | Make it possible to reclaim items from a specific NUMA domain. - Add uma_zone_reclaim_domain() and uma_reclaim_domain(). - Permit parallel reclamations. Use a counter instead of a flag to synchronize with zone_dtor(). - Use the zone lock to protect cache_shrink() now that parallel reclaims can happen. - Add a sysctl that can be used to trigger reclamation from a specific domain. Currently the new KPIs are unused, so there should be no functional change. Reviewed by: mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29685 (cherry picked from commit aabe13f1450bb4caba66ec2a7a41c0dfefff511d)
* Document that uma_zfree_pcpu() allows NULL nowKristof Provost2021-03-191-1/+17
| | | | | | | | | | | While here also document that for counter_u64_free(). Reviewed by: rpokala@ MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29215 (cherry picked from commit 51dc8e7f688867e73eb7edc6bc65fdc77c9d5fff)
* Fix function name in zone.9Warner Losh2020-08-201-3/+3
| | | | | | | | uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the docs for it describe uma_prealloc exactly. Notes: svn path=/head/; revision=364424
* Remove free_domain() and uma_zfree_domain().Mark Johnston2020-08-041-8/+1
| | | | | | | | | | | | | | These functions were introduced before UMA started ensuring that freed memory gets placed in domain-local caches. They no longer serve any purpose since UMA now provides their functionality by default. Remove them to simplyify the kernel memory allocator interfaces a bit. Reviewed by: cem, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25937 Notes: svn path=/head/; revision=363834
* uma: add UMA_ZONE_CONTIG, and a default contig_allocRyan Libby2020-02-041-7/+7
| | | | | | | | | | | For now, copy the mbuf allocator. Reviewed by: jeff, markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23237 Notes: svn path=/head/; revision=357547
* uma: reorganize flagsRyan Libby2020-01-091-20/+12
| | | | | | | | | | | | | | | | | | | | - Garbage collect UMA_ZONE_PAGEABLE & UMA_ZONE_STATIC. - Move flag VTOSLAB from public to private. - Introduce public NOTPAGE flag and make HASH private. - Introduce public NOTOUCH flag and make OFFPAGE private. - Update man page. The net effect of this should be to make the contract with clients more clear. Clients should choose constraints, UMA will figure out how to implement them. This also breaks the confusing double meaning of OFFPAGE. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23016 Notes: svn path=/head/; revision=356534
* Revise the page cache size policy.Mark Johnston2019-11-221-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In r353734 the use of the page caches was limited to systems with a relatively large amount of RAM per CPU. This was to mitigate some issues reported with the system not able to keep up with memory pressure in cases where it had been able to do so prior to the addition of the direct free pool cache. This change re-enables those caches. The change modifies uma_zone_set_maxcache(), which was introduced specifically for the page cache zones. Rather than using it to limit only the full bucket cache, have it also set uz_count_max to provide an upper bound on the per-CPU cache size that is consistent with the number of items requested. Remove its return value since it has no use. Enable the page cache zones unconditionally, and limit them to 0.1% of the domain's pages. The limit can be overridden by the vm.pgcache_zone_max tunable as before. Change the item size parameter passed to uma_zcache_create() to the correct size, and stop setting UMA_ZONE_MAXBUCKET. This allows the page cache buckets to be adaptively sized, like the rest of UMA's caches. This also causes the initial bucket size to be small, so only systems which benefit from large caches will get them. Reviewed by: gallatin, jeff MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22393 Notes: svn path=/head/; revision=355002
* Extend uma_reclaim() to permit different reclamation targets.Mark Johnston2019-09-011-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The page daemon periodically invokes uma_reclaim() to reclaim cached items from each zone when the system is under memory pressure. This is important since the size of these caches is unbounded by default. However it also results in bursts of high latency when allocating from heavily used zones as threads miss in the per-CPU caches and must access the keg in order to allocate new items. With r340405 we maintain an estimate of each zone's usage of its (per-NUMA domain) cache of full buckets. Start making use of this estimate to avoid reclaiming the entire cache when under memory pressure. In particular, introduce TRIM, DRAIN and DRAIN_CPU verbs for uma_reclaim() and uma_zone_reclaim(). When trimming, only items in excess of the estimate are reclaimed. Draining a zone reclaims all of the cached full buckets (the previous behaviour of uma_reclaim()), and may further drain the per-CPU caches in extreme cases. Now, when under memory pressure, the page daemon will trim zones rather than draining them. As a result, heavily used zones do not incur bursts of bucket cache misses following reclamation, but large, unused caches will be reclaimed as before. Reviewed by: jeff Tested by: pho (an earlier version) MFC after: 2 months Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D16667 Notes: svn path=/head/; revision=351673
* Update and clean up the UMA man page.Mark Johnston2019-08-301-91/+264
| | | | | | | | | | | | | | | | | | - Fix warnings from igor and mandoc. - Provide a brief description of the separation between zones and their backend slab allocators. - Document cache zones and secondary zones. - Document the kernel config options added in r350659. - Document the uma_zalloc_pcpu() and uma_zfree_pcpu() wrappers. - Document uma_zone_reserve(), uma_zone_reserve_kva() and uma_zone_prealloc(). - Document uma_zone_alloc() and uma_zone_freef(). - Add some missing MLINKs and Xrefs. MFC after: 2 weeks Notes: svn path=/head/; revision=351628
* Make UMA and malloc(9) return non-executable memory in most cases.Jonathan T. Looney2018-06-131-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most kernel memory that is allocated after boot does not need to be executable. There are a few exceptions. For example, kernel modules do need executable memory, but they don't use UMA or malloc(9). The BPF JIT compiler also needs executable memory and did use malloc(9) until r317072. (Note that a side effect of r316767 was that the "small allocation" path in UMA on amd64 already returned non-executable memory. This meant that some calls to malloc(9) or the UMA zone(9) allocator could return executable memory, while others could return non-executable memory. This change makes the behavior consistent.) This change makes malloc(9) return non-executable memory unless the new M_EXEC flag is specified. After this change, the UMA zone(9) allocator will always return non-executable memory, and a KASSERT will catch attempts to use the M_EXEC flag to allocate executable memory using uma_zalloc() or its variants. Allocations that do need executable memory have various choices. They may use the M_EXEC flag to malloc(9), or they may use a different VM interfact to obtain executable pages. Now that malloc(9) again allows executable allocations, this change also reverts most of r317072. PR: 228927 Reviewed by: alc, kib, markj, jhb (previous version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15691 Notes: svn path=/head/; revision=335068
* Document new NUMA related syscalls and utility options.Jeff Roberson2018-03-241-3/+26
| | | | | | | Sponsored by: Netflix, Dell/EMC Isilon Notes: svn path=/head/; revision=331508
* Fix formatting errors that resulted in apropos(1) output looking weird.Edward Tomasz Napierala2018-03-171-4/+4
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=331094
* UMA_ZONE_REFCNT was removed.Gleb Smirnoff2017-04-261-15/+1
| | | | | | | | | PR: 209715 Submitted by: Fabian Keil <fk fabiankeil.de> MFC after: 3 days Notes: svn path=/head/; revision=317444
* Fix a bunch of "sentence not on new line" warnings in section 9.Edward Tomasz Napierala2016-06-081-2/+4
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=301590
* Spelling fixes supplied by pfg@, detected with codespell, plusWarren Block2016-05-011-1/+1
| | | | | | | | | additional misspellings detected by igor. MFC after: 1 week Notes: svn path=/head/; revision=298904
* Read-only is hyphenated when it modifies a noun.Warner Losh2016-01-161-1/+1
| | | | Notes: svn path=/head/; revision=294114
* Add a safety net to reclaim mbufs when one of the mbuf zones becomeJonathan T. Looney2015-12-201-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exhausted. It is possible for a bug in the code (or, theoretically, even unusual network conditions) to exhaust all possible mbufs or mbuf clusters. When this occurs, things can grind to a halt fairly quickly. However, we currently do not call mb_reclaim() unless the entire system is experiencing a low-memory condition. While it is best to try to prevent exhaustion of one of the mbuf zones, it would also be useful to have a mechanism to attempt to recover from these situations by freeing "expendable" mbufs. This patch makes two changes: a) The patch adds a generic API to the UMA zone allocator to set a function that should be called when an allocation fails because the zone limit has been reached. Because of the way this function can be called, it really should do minimal work. b) The patch uses this API to try to free mbufs when an allocation fails from one of the mbuf zones because the zone limit has been reached. The function schedules a callout to run mb_reclaim(). Differential Revision: https://reviews.freebsd.org/D3864 Reviewed by: gnn Comments by: rrs, glebius MFC after: 2 weeks Sponsored by: Juniper Networks Notes: svn path=/head/; revision=292484
* Fix various mdoc issues and some EOL whitespace.Christian Brueffer2014-12-211-1/+1
| | | | | | | Found with: mandoc -Tlint Notes: svn path=/head/; revision=275993
* use .Mt to mark up email addresses consistently (part6)Baptiste Daroussin2014-06-261-3/+3
| | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de> Notes: svn path=/head/; revision=267936
* Provide macros that allow easily export uma(9) zone limits andGleb Smirnoff2014-02-071-1/+38
| | | | | | | | | | | | | | current usage via sysctl(9): SYSCTL_UMA_MAX() SYSCTL_ADD_UMA_MAX() SYSCTL_UMA_CUR() SYSCTL_ADD_UMA_CUR() Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=261593
* Remove contractions.Joel Dahl2013-04-111-1/+1
| | | | Notes: svn path=/head/; revision=249373
* Merge from projects/counters: UMA_ZONE_PCPU zones.Gleb Smirnoff2013-04-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | These zones have slab size == sizeof(struct pcpu), but request from VM enough pages to fit (uk_slabsize * mp_ncpus). An item allocated from such zone would have a separate twin for each CPU in the system, and these twins are at a distance of sizeof(struct pcpu) from each other. This magic value of distance would allow us to make some optimizations later. To address private item from a CPU simple arithmetics should be used: item = (type *)((char *)base + sizeof(struct pcpu) * curcpu) These arithmetics are available as zpcpu_get() macro in pcpu.h. To introduce non-page size slabs a new field had been added to uma_keg uk_slabsize. This shifted some frequently used fields of uma_keg to the fourth cache line on amd64. To mitigate this pessimization, uma_keg fields were a bit rearranged and least frequently used uk_name and uk_link moved down to the fourth cache line. All other fields, that are dereferenced frequently fit into first three cache lines. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=249264
* Document some flags to the uma_zcreate(). Not all flags are documented,Gleb Smirnoff2013-03-211-0/+54
| | | | | | | | only those that at least are used in the kernel, or that definitely work. Notes: svn path=/head/; revision=248588
* Document uma_find_refcnt().Gleb Smirnoff2013-03-211-1/+11
| | | | Notes: svn path=/head/; revision=248586
* Implemented uma_zone_set_warning(9) function that sets a warning, whichPawel Jakub Dawidek2012-12-071-2/+15
| | | | | | | | | | | | | | | will be printed once the given zone becomes full and cannot allocate an item. The warning will not be printed more often than every five minutes. All UMA warnings can be globally turned off by setting sysctl/tunable vm.zone_warnings to 0. Discussed on: arch Obtained from: WHEEL Systems MFC after: 2 weeks Notes: svn path=/head/; revision=243998
* Make it clear that NULL can only be returned when M_NOWAIT was used.Edward Tomasz Napierala2012-10-281-4/+6
| | | | Notes: svn path=/head/; revision=242270
* Fix various typos in manual pages.Glen Barber2012-02-251-2/+2
| | | | | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week Notes: svn path=/head/; revision=232157
* Globally replace u_int*_t from (non-contributed) man pages.Ed Schouten2012-02-121-1/+1
| | | | | | | | | | | | | | The reasoning behind this, is that if we are consistent in our documentation about the uint*_t stuff, people will be less tempted to write new code that uses the non-standard types. I am not going to bump the man page dates, as these changes can be considered style nits. The meaning of the man pages is unaffected. MFC after: 1 month Notes: svn path=/head/; revision=231564
* Re-encode files from ISO-8859-1 to UTF-8Ulrich Spörlein2011-05-221-1/+1
| | | | Notes: svn path=/head/; revision=222176
* uma_zfree(zone, NULL) should do nothing, to match free(9).Matthew D Fleming2010-10-191-0/+7
| | | | | | | | Noticed by: Ron Steinke <rsteinke at isilon dot com> MFC after: 3 days Notes: svn path=/head/; revision=214062
* Change uma_zone_set_max to return the effective value of "nitems" afterLawrence Stewart2010-10-161-4/+4
| | | | | | | | | | | rounding. The same value can also be obtained with uma_zone_get_max, but this change avoids a caller having to make two back-to-back calls. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jhb Notes: svn path=/head/; revision=213911
* - Simplify implementation of uma_zone_get_max.Lawrence Stewart2010-10-161-9/+30
| | | | | | | | | | | | - Add uma_zone_get_cur which returns the current approximate occupancy of a zone. This is useful for providing stats via sysctl amongst other things. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jhb MFC after: 2 weeks Notes: svn path=/head/; revision=213910
* Document the _arg versions of the uma_zalloc and uma_zfree functions.Remko Lodder2008-06-191-1/+18
| | | | | | | | | PR: docs/120357 Submitted by: gahr MFC after: 3 days Notes: svn path=/head/; revision=179880
* Bump document date for the previous change.Ruslan Ermilov2006-10-211-1/+1
| | | | Notes: svn path=/head/; revision=163577
* Remove long untrue note about storing state information inside free items.Konstantin Belousov2006-10-021-19/+1
| | | | | | | | | OKed by: rwatson, tegge Approved by: pjd (mentor) MFC after: 1 week Notes: svn path=/head/; revision=162946
* I don't normally use my middle name, so remove it from attributions inDag-Erling Smørgrav2004-01-251-1/+1
| | | | | | | | man pages (though not from copyright notices). While I'm here, add email addresses where appropriate. Notes: svn path=/head/; revision=124963
* Document uma_zone_set_max and its non-obvious behaviour.Hartmut Brandt2003-07-211-2/+21
| | | | | | | Reviewed by: bmilekic Notes: svn path=/head/; revision=117836
* Various mdoc(7) fixes:Hiten Pandya2003-05-311-1/+1
| | | | | | | | | | | Add devfs(5) reference - make_dev.9 Change .Xr from VFS_VGET(9) to vget(9) - vnode.9 Spelling fix, 'useage' to 'usage' - zone.9 Approved by: des (mentor) Notes: svn path=/head/; revision=115441
* mdoc(7) police: scheduled sweep.Ruslan Ermilov2002-11-291-7/+16
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107383
* Flesh out the description of the uma_zcreate callback function arguementsAlfred Perlstein2002-11-181-0/+35
| | | | | | | a bit. As there may be changes soon we're still a bit vague unfortunatly. Notes: svn path=/head/; revision=107032
* mdoc(7) police: Fix SYNOPSIS, bump document date.Ruslan Ermilov2002-05-301-7/+9
| | | | Notes: svn path=/head/; revision=97578
* Add description for uma_zcreate().Jeroen Ruigrok van der Werven2002-05-181-0/+12
| | | | | | | Submitted by: arr Notes: svn path=/head/; revision=96852
* Chase the sources and document the change of wait to flags, which areJeroen Ruigrok van der Werven2002-04-301-8/+4
| | | | | | | | | the normal malloc(9) flags. Submitted by: arr Notes: svn path=/head/; revision=95805
* Remove references to zinit() which does not exist anymore.Jeroen Ruigrok van der Werven2002-04-301-13/+2
| | | | Notes: svn path=/head/; revision=95802
* Document the zone allocator is now a slab allocator.Jeroen Ruigrok van der Werven2002-04-301-0/+8
| | | | | | | Show Jeff's work and your's truly manual page updates. Notes: svn path=/head/; revision=95800
* Document uma_zalloc() behaviour.Jeroen Ruigrok van der Werven2002-04-301-2/+15
| | | | Notes: svn path=/head/; revision=95798
* Update function arguments to what is current used.Jeroen Ruigrok van der Werven2002-04-301-3/+3
| | | | Notes: svn path=/head/; revision=95796