Page MenuHomeFreeBSD

malloc: Fix domainset usage in malloc_domainset() for large allocs
ClosedPublic

Authored by markj on Jul 17 2026, 9:13 PM.
Tags
None
Referenced Files
F174847242: D58316.id183153.diff
Tue, Oct 6, 11:57 AM
F174828448: D58316.diff
Tue, Oct 6, 7:02 AM
Unknown Object (File)
Mon, Oct 5, 9:59 AM
Unknown Object (File)
Sun, Oct 4, 7:05 PM
Unknown Object (File)
Mon, Sep 28, 5:16 AM
Unknown Object (File)
Sat, Sep 26, 8:40 AM
Unknown Object (File)
Sun, Sep 20, 7:03 AM
Unknown Object (File)
Sun, Sep 20, 5:25 AM
Subscribers

Details

Summary

We should of course pass the provided domainset rather than copying what
plain malloc() does.

Fixes: 89deca0a3361 ("malloc: make malloc_large closer to standalone")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74903
Build 71786: arc lint + arc unit

Event Timeline

Maybe one day we should plumb it for malloc_dbg / memguard_alloc too.

This revision is now accepted and ready to land.Jul 17 2026, 9:22 PM

Maybe one day we should plumb it for malloc_dbg / memguard_alloc too.

Do you use memguard at all? I haven't needed to reach for it since KASAN was added.

Maybe one day we should plumb it for malloc_dbg / memguard_alloc too.

Do you use memguard at all? I haven't needed to reach for it since KASAN was added.

Yes, though maybe there's a better way to do what we're doing. memguard can be used with only small performance impact for types/zones that don't match vm.memguard.desc. Actually I was recently thinking about a way to use memguard more broadly for infrequent allocations.