HomeFreeBSD

uma: New check_align_mask(): Validate alignments (INVARIANTS)

Description

uma: New check_align_mask(): Validate alignments (INVARIANTS)

New function check_align_mask() asserts (under INVARIANTS) that the mask
fits in a (signed) integer (see the comment) and that the corresponding
alignment is a power of two.

Use check_align_mask() in uma_set_align_mask() and also in uma_zcreate()
to replace the KASSERT() there (that was checking only for a power of
2).

Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42263

(cherry picked from commit 87090f5e5a7b927a2ab30878435f6dcba0705a1d)

Details

Provenance
olceAuthored on Oct 13 2023, 2:09 PM
markjCommitted on Nov 16 2023, 3:07 PM
Reviewer
kib
Differential Revision
D42263: uma: New check_align_mask(): Validate alignments (INVARIANTS)
Parents
rG690ca45aeb8c: uma: Make the cache alignment mask unsigned
Branches
Unknown
Tags
Unknown