Repository navigation
Refactor representation of thread local state. - #751
Conversation
318a880 to
0614a01
Compare
80d24e0 to
0fd6768
Compare
|
Only found time to make it into "Restrict ThreadAlloc usage to globalalloc", but so far so great. Thanks for nwfifying the commit stack. :D |
41392d1 to
654bcfd
Compare
Nathaniel Wesley Filardo (nwf)
left a comment
There was a problem hiding this comment.
This continues to look really nice. (Read up through "WIP", exclusive.)
| return self->alloc_not_small<zero_mem, CheckInitDefault>(size); | ||
| }, | ||
| size, | ||
| this); |
There was a problem hiding this comment.
It's a bit of a pity that something so formulaic can't, AFAIK, be templated away.
654bcfd to
fdab65d
Compare
|
Nathaniel Wesley Filardo (@nwf) thanks for the comments. I've addressed them. And I landed the first set of commits in #750. |
997eed4 to
ab58e2f
Compare
295eaa4 to
ed81ba7
Compare
The check init code was tightly integrated into LocalAllocator. This commit pull that code out into ThreadAlloc, and passes a template parameter into the remaining LocalAllocator to perform the relevant TLS manipulations. This removes some of the awkward layering around register_clean_up.
Fully disable lotsofthreads test Need to investigate if the test is unreliable, or we have actually regressed perf. A quick mimalloc-bench didn't show any regressions.
This introduces one additional branch on when processing a batch of messages, but it is likely to only be hit when a lot of messages are processed.
ed81ba7 to
48fa1c4
Compare
This combines the notion of CoreAlloc, LocalAlloc and LocalCache into a single class. Previously, these were separated so that a more complex structure would be stored directly in the TLS. This however, proved to be bad for compatibility if the allocator is part of the libc implementation. This commit collapses all the stages of the allocator into a single class. This simplifies the sequencing and overall is a nice reduction in complexity.
48fa1c4 to
6f7c8ec
Compare
55ed776 to
35d5f46
Compare
35d5f46 to
bbc41b6
Compare
|
I have been through this carefully today, and am going to merge. There is one outstanding issue that I am not sure how we should modify the domestication test. There is complexity with how BatchIt interacts. I will raise an issue to fix this down the line, but this shouldn't block other work. |
Change thread local state to be a single pointer to a backend allocated structure. Previously, the TLS contained a complex structure, but that didn't interact well with loading numerous copies at once.