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)
Thu, Nov 14, 6:43 AM
Unknown Object (File)
Tue, Nov 12, 10:08 PM
Unknown Object (File)
Tue, Nov 12, 9:55 PM
Unknown Object (File)
Tue, Nov 5, 8:53 AM
Unknown Object (File)
Oct 25 2024, 6:16 AM
Unknown Object (File)
Oct 19 2024, 11:54 PM
Unknown Object (File)
Oct 19 2024, 6:30 AM
Unknown Object (File)
Sep 26 2024, 11:51 PM
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