Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up of gc debugging and page management code #16385

Merged
merged 10 commits into from
May 19, 2016
Merged

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented May 16, 2016

This is a rewrite of #13968 with a few related clean ups.

  • Remove most of the GC macros that are hard to reason about. (or make code searching harder).
  • Split page management and debugging code into separate compilation units.
  • Move jl_thread_heap_t into jl_tls_states_t. Remove some infrastructures for accessing TLS variables on a different thread that exists before jl_tls_states_t.
  • Increase maximum region count, make region size dynamic. (Fix mmap failure with address space quotas #10390.)

I believe most of the changes should only affect slow path.

@yuyichao yuyichao added the GC Garbage collector label May 16, 2016
@yuyichao
Copy link
Contributor Author

Ah, there's another change (flip the meaning of freemap) in #13968 that I haven't incorporated yet. I'll include that later.

c.c. @carnaval

@yuyichao
Copy link
Contributor Author

yuyichao commented May 16, 2016

freemap is replaced by allocmap now. Also fixed the excessive allocation of page ages which was noticed by @carnaval in a heap profile.

@yuyichao
Copy link
Contributor Author

Threading CI passed Travis, AppVeyor


// A region is contiguous storage for up to REGION_PG_COUNT naturally aligned GC_PAGE_SZ pages
// It uses a very naive allocator (see jl_gc_alloc_page & jl_gc_free_page)
#if defined(_P64) && !defined(_COMPILER_MICROSOFT_)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be able to remove the msvc ifdef now if it's dynamically allocated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, forgot about this one....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Replace `PAGE_INDEX` with inline function.
@yuyichao
Copy link
Contributor Author

I left the gcc workaround there. Unless someone can check on GCC 4.7 whether it is a problem.

@carnaval
Copy link
Contributor

lgtm, thanks. happy to see the current_heap macros go away too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants