git: c26549327f42 - stable/13 - subr_unit.c: explain first/last special ranges
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 05 Jun 2023 08:36:03 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c26549327f425bc1b0272037d524af18392c0c88
commit c26549327f425bc1b0272037d524af18392c0c88
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-05-14 23:11:17 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-06-05 08:35:01 +0000
subr_unit.c: explain first/last special ranges
(cherry picked from commit d44f477038d3ede5fe62fa19c9301b43455cd8f1)
---
sys/kern/subr_unit.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c
index 6c1368c64e00..a78b6ddf4840 100644
--- a/sys/kern/subr_unit.c
+++ b/sys/kern/subr_unit.c
@@ -191,6 +191,12 @@ mtx_assert(struct mtx *mp, int flag)
* For bitmaps the len field represents the number of allocated items.
*
* The bitmap is the same size as struct unr to optimize memory management.
+ *
+ * Two special ranges are not covered by unrs:
+ * - at the start of the allocator space, all elements in [low, low + first)
+ * are allocated;
+ * - at the end of the allocator space, all elements in [high - last, high]
+ * are free.
*/
struct unr {
TAILQ_ENTRY(unr) list;