Skip to content

Add arena.i.retain_grow_limit - #1064

Merged
interwq merged 1 commit into
jemalloc:devfrom
interwq:retain
Nov 3, 2017
Merged

interwq merged 1 commit into
jemalloc:devfrom
interwq:retain

Conversation

@interwq

@interwq interwq commented Nov 3, 2017

Copy link
Copy Markdown
Contributor

This option controls the max size when grow_retained. This is useful when we
have customized extent hooks reserving physical memory (e.g. 1G huge pages).
Without this feature, the default increasing sequence could result in fragmented
and wasted physical memory.

@interwq

interwq commented Nov 3, 2017

Copy link
Copy Markdown
Contributor Author

As discussed offline with @davidtgoldblatt and @djwatson, this solves an immediate issue with 1G hugepages. Long term we'd need to solve this at the extent hook API level (#1009).

This option controls the max size when grow_retained.  This is useful when we
have customized extent hooks reserving physical memory (e.g. 1G huge pages).
Without this feature, the default increasing sequence could result in fragmented
and wasted physical memory.
Comment thread src/arena.c
size_t *new_limit) {
assert(opt_retain);

pszind_t new_ind JEMALLOC_CC_SILENCE_INIT(0);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous CI test failures were complaining about this being unused uninitialized.

Comment thread src/arena.c
assert(opt_retain);

pszind_t new_ind JEMALLOC_CC_SILENCE_INIT(0);
if (new_limit != NULL) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this should either be an error, or, if we want a null new-limit to mean "unlimited", we should document that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait I'm dumb, there should be a way to get the current limit. nvm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. NULL new_limit means reading the value.

@interwq interwq mentioned this pull request Nov 3, 2017
@interwq

interwq commented Nov 3, 2017

Copy link
Copy Markdown
Contributor Author

OSX tests passed previously. Merging.

@interwq
interwq merged commit e422fa8 into jemalloc:dev Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants