Skip to content

Think about how to work with overallocating hooks #952

Open

Description

@davidtgoldblatt

After the extent migration, we have a much cleaner and finer-grained metadata tracking system. One interesting side effect though, was that users could no longer rely on being able to only work with large allocation sizes.

Two examples where this matters:

  • Suppose a user has a metadata tracking system in which a 2MB region contains all objects of a particular type, so that they can look up object type given the address very easily. If they want to keep this strategy at this granularity, they have to implement an allocator on top of the allocator, keeping track of when their 2MB chunks become empty and ready for reuse. On our end, we won't be able to work to empty those chunks empty, since we aren't able to tell tell that they have any relation to each other; that information is hidden from us.
  • Suppose a user wants to do their allocations only with hugepages. Morally, there's not a great reason why they should have to do any metadata tracking at all. All of a sudden they have to, because freeing/purging logic then needs to happen at the 2MB-page granularity.

We talked about this on the gitter:
https://gitter.im/jemalloc/jemalloc?at=59441c55d83c50560c157dc3

One thing we could do is separate the "extent as metadata for a region of memory" functionality from the "extent as unit of interaction with the underlying allocation mechanism" one. The user only cares about the latter (I suppose we could inform them about decisions made in the former, if they're curious). If the user doesn't want to overallocate, or if arbitrary splitting is allowed, we can ignore the problem and merge the two concepts into one representation, so that, absent a user requirement, we don't change any layout policies or incur any overhead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions