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)
Sat, Oct 18, 12:46 PM
Unknown Object (File)
Mon, Oct 13, 1:18 AM
Unknown Object (File)
Thu, Oct 9, 9:31 PM
Unknown Object (File)
Fri, Oct 3, 3:26 PM
Unknown Object (File)
Fri, Oct 3, 1:52 AM
Unknown Object (File)
Thu, Oct 2, 5:43 PM
Unknown Object (File)
Wed, Oct 1, 10:51 PM
Unknown Object (File)
Sep 13 2025, 2:39 AM
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.