Page MenuHomeFreeBSD

malloc(9): assert wait flags.
ClosedPublic

Authored by des on Oct 28 2024, 2:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 10, 2:36 AM
Unknown Object (File)
Sat, Nov 1, 10:16 AM
Unknown Object (File)
Sat, Nov 1, 4:08 AM
Unknown Object (File)
Wed, Oct 29, 1:28 AM
Unknown Object (File)
Sat, Oct 18, 12:46 PM
Unknown Object (File)
Oct 13 2025, 1:18 AM
Unknown Object (File)
Oct 9 2025, 9:31 PM
Unknown Object (File)
Oct 3 2025, 3:26 PM
Subscribers

Details

Summary

The check introduced in d3c11994e1e3 was bogus, combining a non-atomic
“once” flag with an equally non-thread-safe ppsratecheck. Rather than
fix it, just assert what it attempts to enforce: that the malloc flags
must include exactly one of M_WAITOK and M_NOWAIT.

Fixes: d3c11994e1e3de7445305abd0d41dce2b8d3e6dc
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Oct 28 2024, 2:56 PM
olce requested changes to this revision.Oct 28 2024, 3:04 PM
olce added inline comments.
sys/kern/kern_malloc.c
530

Parentheses missing.

This revision now requires changes to proceed.Oct 28 2024, 3:04 PM
des marked an inline comment as done.Oct 29 2024, 5:41 PM
This revision is now accepted and ready to land.Oct 29 2024, 5:43 PM
This revision was automatically updated to reflect the committed changes.