Page MenuHomeFreeBSD

Implement fast path for malloc and free
AbandonedPublic

Authored by mjg on Jun 10 2018, 1:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 2:54 AM
Unknown Object (File)
Oct 21 2024, 5:16 PM
Unknown Object (File)
Oct 21 2024, 5:16 PM
Unknown Object (File)
Oct 21 2024, 5:16 PM
Unknown Object (File)
Oct 21 2024, 4:55 PM
Unknown Object (File)
Oct 11 2024, 5:21 PM
Unknown Object (File)
Sep 28 2024, 5:41 PM
Unknown Object (File)
Sep 23 2024, 2:39 AM
Subscribers

Details

Reviewers
jeff
markj
Summary

Avoids func calls and branches in the common case.

malloc+free throughput per second: ~19323918 to ~27418181.

lock1 from will-it-scale (single-threaded): 2196902 -> 2345506

Test Plan

make universe. running with DEBUG_REDZONE and DEBUG_MEMGUARD

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Does this not include the malloc.h changes for M_ZERO?

Can we do constant size at the same time?

sys/kern/kern_malloc.c
656โ€“662

This should be a uma_int.h inline.

867โ€“871

Should also be an inline. Possibly with some of the code above.

The M_ZERO stuff went in quite some time ago.

I plan to deal with static one lookup later.

I don't think the inlined cache bump matters. But if you insist i can move it to a dedicated routine.

mjg planned changes to this revision.Aug 31 2019, 9:50 AM

Apart from addressing this review request this needs some reworking due to other changes in uma.