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)
Fri, Jan 31, 12:20 PM
Unknown Object (File)
Thu, Jan 30, 6:56 AM
Unknown Object (File)
Wed, Jan 29, 2:13 PM
Unknown Object (File)
Wed, Jan 29, 1:00 PM
Unknown Object (File)
Thu, Jan 23, 7:37 PM
Unknown Object (File)
Tue, Jan 21, 1:03 AM
Unknown Object (File)
Mon, Jan 20, 9:23 PM
Unknown Object (File)
Sun, Jan 19, 2:16 PM
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.