From nobody Mon May 29 22:11:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QVV9P1Nb6z4XFhy; Mon, 29 May 2023 22:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QVV9N5F2Qz3K7K; Mon, 29 May 2023 22:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685398280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eBBgVEMf8TL+na10yfBuiv/aJh0UBRD1YnbMrE+3Ehk=; b=l2H5GVmJxl7+2FI28DELuTCtp7lgMy9Bfut68PiegvOOGfkHYKYYCvwHim41AELPtsFv7k mf+rQORGmmUE5Ab7WrBy044QxQEKy0e8H2pKn5+r+37OcyhfqtykvDKTzAWzbAMcTBeX3M vgEFO3JiOIRnVeB22QvT1GwbpHWNsY8jzon5JzksJEDrMWnitolddMVezZZlhDKqp7dFlm nSq7SAckJcwCYu0L939beyg6zq42ijQMcFH0TaPCPh2oXYFUbUUL4Eg/424zjf3tyMuZx7 pUtGrkMpUDGKhwCslnopyjOgnKIh6xsh7r/LE/AupwePM7LVpgll7ix5vyqRbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685398280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eBBgVEMf8TL+na10yfBuiv/aJh0UBRD1YnbMrE+3Ehk=; b=N5XGBHWcEXQqRd0LCwTh0G4uIIY7RBLglbq+q9Wzpg16eD+BVEnXwqdZwbLHLwabOaqQ1g mFY5WJnVoGiEqs2zOm+dQi81AsBoCjHk+DI7qX3z656WwcbZKxf7OB5siRAK23q3o3xlQ6 Jcp/uKRuYkX7ZV7ULBL6mLn+K6zCKnFs6sEfhs90nrabIzQFTttNRbMr+2RpAG19eQNz4q njI5ld26LhMMKzbDXfN5KtanldHwWla+Vbe8JUZHRvdlGkYi05HL0lnCcztDa5AdHUTPLE 1EeIf+kw8TcCgaEWBMSSjYuFgoFCH4/THy9+NoqST7gvfmpWt7LssH2tR+84Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685398280; a=rsa-sha256; cv=none; b=NMkHIMjlzrDmhZV5NzdbYl71Nhs+9pwldJfpWRbOq1HrhsUw2P25Z+CLoIJaHBKRKXkMkU EECrNRt7HEJW4AHtIU9vtGvB3rsdnUpl2u2wE7G7dUeBOjxmIXAvPs72UwkckGGMkT3dbN q+hNQvSh59zI18XL2AGi0sEJZWUVCwdcW+apN3+3EvSIfXXxiXzxMXsDJSCMlwqHVFCycZ UHwXIg2Tiu3RIt5mVo5c4oFC50QzBWyYcTydNY26nit52rrYXdyudGmK+vRTg3iiUmjbhG xLcFllC85j52aheVzGL6cZBTlxgcum/IY+aIWP9OaSdqO0gexh+AQ23+dFt2Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QVV9N4GkWzTNK; Mon, 29 May 2023 22:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34TMBKk7043832; Mon, 29 May 2023 22:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34TMBKGJ043831; Mon, 29 May 2023 22:11:20 GMT (envelope-from git) Date: Mon, 29 May 2023 22:11:20 GMT Message-Id: <202305292211.34TMBKGJ043831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d44f477038d3 - main - subr_unit.c: explain first/last special ranges List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d44f477038d3ede5fe62fa19c9301b43455cd8f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d44f477038d3ede5fe62fa19c9301b43455cd8f1 commit d44f477038d3ede5fe62fa19c9301b43455cd8f1 Author: Konstantin Belousov AuthorDate: 2023-05-14 23:11:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-29 22:10:35 +0000 subr_unit.c: explain first/last special ranges Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40089 --- 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 a1878ea4b144..b0977c3c01b9 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -178,6 +178,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;