Page MenuHomeFreeBSD

malloc: delegate M_EXEC handling to malloc_exec + clean up a little
ClosedPublic

Authored by mjg on Oct 30 2020, 3:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 12, 1:44 AM
Unknown Object (File)
Dec 20 2023, 6:26 AM
Unknown Object (File)
Oct 24 2023, 4:06 PM
Unknown Object (File)
Sep 3 2023, 7:07 AM
Unknown Object (File)
Sep 3 2023, 7:07 AM
Unknown Object (File)
Sep 3 2023, 7:05 AM
Unknown Object (File)
Sep 3 2023, 7:03 AM
Unknown Object (File)
Aug 28 2023, 9:39 AM
Subscribers

Details

Summary

This removes a branch for handling an almost-unused case.

Slight clean up is in preparation for resurecting the fast path malloc/free patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Oct 30 2020, 3:19 PM

I think this is fine. I wouldn't even bother with malloc_exec(), you could just modify the few existing users to call kmem_malloc(M_EXEC).

In either case, a man page update is needed.

sys/kern/kern_malloc.c
657 ↗(On Diff #78951)

and -> an

They had kmem_malloc and that got patched to malloc(...., M_EXEC) so I did not deviate from the general direction. That said, I'm indifferent to this one as long as the flag is gone from malloc itself.

In D27019#602758, @mjg wrote:

They had kmem_malloc and that got patched to malloc(...., M_EXEC) so I did not deviate from the general direction. That said, I'm indifferent to this one as long as the flag is gone from malloc itself.

It was malloc(), then r317072 changed to kmem_malloc(), then it was changed back when M_EXEC was added.

I don't have strong feelings either way; the main advantage of malloc_exec() is malloc type tracking. If you prefer having malloc_exec() then this diff LGTM so long as the man page is updated.

  • also patch malloc_domainset
  • manpage
markj added inline comments.
share/man/man9/malloc.9
93 ↗(On Diff #78977)

There should be a newline after the first period.

Note -> Not

This revision is now accepted and ready to land.Oct 30 2020, 7:46 PM