Page MenuHomeFreeBSD

malloc(9): introduce M_NEVERFREED
AcceptedPublic

Authored by bnovkov on Wed, May 1, 1:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 13, 7:10 AM
Unknown Object (File)
Fri, May 10, 3:50 AM
Unknown Object (File)
Thu, May 9, 1:27 AM
Unknown Object (File)
Sat, May 4, 5:42 PM
Unknown Object (File)
Thu, May 2, 2:36 AM
Unknown Object (File)
Thu, May 2, 2:36 AM
Unknown Object (File)
Wed, May 1, 11:31 PM
Subscribers

Details

Reviewers
kib
alc
markj
Summary

This patch adds an additional malloc(9) flag to distinguish UMA_ZONE_NOFREE allocations, as previously discussed in https://reviews.freebsd.org/D16620.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Why not M_NOFREE?

I believe that the addition require some (perhaps relatively comprehensive) explanation where to use the flag, and where not to. E.g. is it available to the casual malloc(9) user?

In D45045#1027214, @kib wrote:

Why not M_NOFREE?

M_NOFREE was already taken by sys/mbuf.h, M_NEVERFREED is one of the alternative names proposed by @alc .

I believe that the addition require some (perhaps relatively comprehensive) explanation where to use the flag, and where not to. E.g. is it available to the casual malloc(9) user?

I see this as more of an internal flag meant to be used by allocators rather than users. At the moment passing it to malloc(9) would effectively be a no-op as its only used by small_alloc.
I refrained from modifying the manpages until we discussed this collectively, but I'll definitely add an explanation once we settle on something.

Mentioning the supposed scope of use for flag in the review would be best. BTW if it is internal to vm allocators, why not call it M_VM_NOFREE?

This revision is now accepted and ready to land.Fri, May 3, 12:36 AM