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)
Jan 1 2024, 3:14 AM
Unknown Object (File)
Sep 29 2023, 2:49 AM
Unknown Object (File)
Aug 27 2023, 6:52 AM
Unknown Object (File)
Aug 13 2023, 6:13 AM
Unknown Object (File)
Jan 13 2023, 6:09 AM
Unknown Object (File)
Nov 29 2022, 2:54 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.