Project

General

Profile

Feature #1920

Make mempool aware of Isomalloc's per-slot metadata

Added by Sam White 5 months ago. Updated about 2 months ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
AMPI
Target version:
-
Start date:
05/22/2018
Due date:
% Done:

0%

Tags:

Description

By default Isomalloc uses the mempool implementation in src/arch/util/mempool.{h,c}.
That mempool always allocates memory in slots that are powers of two sized, with the smallest slot being I think 64 Bytes.
Isomalloc adds its own small metadata (~32 Bytes) to each of the application's allocations for its own bookkeeping.
As a consequence, if the user calls "malloc(64*1024*1024)" they will get a slot in the mempool that is actually get a 128 MB for an allocation that is 64MB + 32B.
We should instead make the mempool aware of Isomalloc's small metadata so that it plays nicely with even powers-of-two allocation sizes.

History

#1 Updated by Sam White 5 months ago

  • Tags set to isomalloc

#2 Updated by Sam White 5 months ago

  • Assignee set to Evan Ramos

#3 Updated by Sam White 2 months ago

  • Assignee deleted (Evan Ramos)
  • Status changed from New to Rejected

Evan looked into this and said it would be a bit tricky to implement, and making Isomalloc not use the mempool seems like a better long term move anyways, so rejecting...

#4 Updated by Evan Ramos about 2 months ago

Yeah, this is a fundamental design flaw in the mempool, instead of an edge case that should be patched in. I've repeatedly tried to work on the mempool and found it difficult to read and non-modular. Based on its simplistic handling of allocations and complex code, ideally I would recommend replacing it with a permissively licensed library that can achieve better results, if we can find one.

Also available in: Atom PDF