<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/vm/uma.h, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F13</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F13'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-12-21T13:40:09Z</updated>
<entry>
<title>uma: Permit specifying max of cache line and some custom alignment</title>
<updated>2023-12-21T13:40:09Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce.freebsd@certner.fr</email>
</author>
<published>2023-10-13T15:05:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6e4b7753610d2594740d73120fe6251ce7f66a61'/>
<id>urn:sha1:6e4b7753610d2594740d73120fe6251ce7f66a61</id>
<content type='text'>
To be used for structures for which we want to enforce that pointers to
them have some number of lower bits always set to 0, while still
ensuring we benefit from cache line alignment to avoid false sharing
between structures and fields within the structures (provided they are
properly ordered).

First candidate consumer that comes to mind is 'struct thread', see next
commit.

Reviewed by:            markj, kib
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42265

(cherry picked from commit 733e0abd2897289e2acf70f7c72e31a5a560394a)

Approved by:    markj (mentor)
</content>
</entry>
<entry>
<title>uma: Make the cache alignment mask unsigned</title>
<updated>2023-12-21T13:39:53Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce.freebsd@certner.fr</email>
</author>
<published>2023-10-13T12:49:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9121202fcb27e981bc4d2a7695fbba463361df93'/>
<id>urn:sha1:9121202fcb27e981bc4d2a7695fbba463361df93</id>
<content type='text'>
In uma_set_align_mask(), ensure that the passed value doesn't have its
highest bit set, which would lead to problems since keg/zone alignment
is internally stored as signed integers.  Such big values do not make
sense anyway and indicate some programming error.  A future commit will
introduce checks for this case and other ones.

Reviewed by:            kib, markj
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42262

(cherry picked from commit 3d8f548b9e5772ff6890bdc01f7ba7b76203857d)

Approved by:    markj (mentor)
</content>
</entry>
<entry>
<title>uma: UMA_ALIGN_CACHE: Resolve the proper value at use point</title>
<updated>2023-12-21T13:39:34Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce.freebsd@certner.fr</email>
</author>
<published>2023-10-13T12:13:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4e00940e9f1f7dc1210a094d916ef930ff447e4a'/>
<id>urn:sha1:4e00940e9f1f7dc1210a094d916ef930ff447e4a</id>
<content type='text'>
Having a special value of -1 that is resolved internally to
'uma_align_cache' provides no significant advantages and prevents
changing that variable to an unsigned type, which is natural for an
alignment mask.  So suppress it and replace its use with a call to
uma_get_align_mask().  The small overhead of the added function call is
irrelevant since UMA_ALIGN_CACHE is only used when creating new zones,
which is not performance critical.

Reviewed by:            markj, kib
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42259

(cherry picked from commit e557eafe7233f8231c1f5f5b098e4bab8e818645)

Approved by:    markj (mentor)
</content>
</entry>
<entry>
<title>uma: Hide 'uma_align_cache'; Create/rename accessors</title>
<updated>2023-12-21T13:39:26Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce.freebsd@certner.fr</email>
</author>
<published>2023-10-13T09:52:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=56c53cc8fb3edaed82678440da5cf8e0dc482d03'/>
<id>urn:sha1:56c53cc8fb3edaed82678440da5cf8e0dc482d03</id>
<content type='text'>
Create the uma_get_cache_align_mask() accessor and put it in a separate
private header so as to minimize namespace pollution in header/source
files that need only this function and not the whole 'uma.h' header.

Make sure the accessors have '_mask' as a suffix, so that callers are
aware that the real alignment is the power of two that is the mask plus
one.  Rename the stem to something more explicit.  Rename
uma_set_cache_align_mask()'s single parameter to 'mask'.

Hide 'uma_align_cache' to ensure that it cannot be set in any other way
then by a call to uma_set_cache_align_mask(), which will perform sanity
checks in a further commit.  While here, rename it to
'uma_cache_align_mask'.

This is also in preparation for some further changes, such as improving
the sanity checks, eliminating internal resolving of UMA_ALIGN_CACHE and
changing the type of the 'uma_cache_align_mask' variable.

Reviewed by:            markj, kib
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42258

(cherry picked from commit dc8f7692fd1de628814f4eaf4a233dccf4c92199)

Approved by:    markj (mentor)
</content>
</entry>
<entry>
<title>uma.h: Fix a typo in a source code comment</title>
<updated>2023-10-18T05:57:39Z</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2023-10-15T12:09:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6c4855c18eed77d2482bbe9cc32498bd3ad6fbe2'/>
<id>urn:sha1:6c4855c18eed77d2482bbe9cc32498bd3ad6fbe2</id>
<content type='text'>
- s/setable/settable/

(cherry picked from commit fc9f1d2c6391b1a4b133aab56ace625b72c9ea85)
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-23T17:43:20Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f8167e0404dab9ffeaca95853dd237ab7c587f82'/>
<id>urn:sha1:f8167e0404dab9ffeaca95853dd237ab7c587f82</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-07-25T15:13:49Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=caa41f641755c935b036e17440a3b49329c904ed'/>
<id>urn:sha1:caa41f641755c935b036e17440a3b49329c904ed</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
</content>
</entry>
<entry>
<title>uma: Add UMA_ZONE_UNMANAGED</title>
<updated>2022-02-24T09:59:28Z</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2022-02-24T09:59:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6bf4f9268fb247248a9e4f33fba1940b46debac7'/>
<id>urn:sha1:6bf4f9268fb247248a9e4f33fba1940b46debac7</id>
<content type='text'>
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)
</content>
</entry>
<entry>
<title>uma: Add KASAN state transitions</title>
<updated>2021-11-01T14:02:54Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-04-13T21:39:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=82f3e32c3958c1fc6e6ab1d7a4440a9be128f205'/>
<id>urn:sha1:82f3e32c3958c1fc6e6ab1d7a4440a9be128f205</id>
<content type='text'>
- Add a UMA_ZONE_NOKASAN flag to indicate that items from a particular
  zone should not be sanitized.  This is applied implicitly for NOFREE
  and cache zones.
- Add KASAN call backs which get invoked:
  1) when a slab is imported into a keg
  2) when an item is allocated from a zone
  3) when an item is freed to a zone
  4) when a slab is freed back to the VM

  In state transitions 1 and 3, memory is poisoned so that accesses will
  trigger a panic.  In state transitions 2 and 4, memory is marked
  valid.
- Disable trashing if KASAN is enabled.  It just adds extra CPU overhead
  to catch problems that are detected by KASAN.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 09c8cb717d214d03e51b3e4f8e9997b9f4e1624d)
</content>
</entry>
<entry>
<title>uma: Introduce per-domain reclamation functions</title>
<updated>2021-04-28T14:00:52Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-04-14T16:57:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0758fa13b43b2b913856b444a65338afadf5abd1'/>
<id>urn:sha1:0758fa13b43b2b913856b444a65338afadf5abd1</id>
<content type='text'>
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)
</content>
</entry>
</feed>
