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

msgpass benchmark and its refactoring dependencies #659

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/snmalloc/mem/corealloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ namespace snmalloc
freelist::Object::make<capptr::bounds::AllocWild>(
capptr_to_user_address_control(curr_ptr.as_void())),
key,
NO_KEY_TWEAK,
entropy);
curr_ptr = curr_ptr->next;
} while (curr_ptr != start_ptr);
Expand All @@ -258,6 +259,7 @@ namespace snmalloc
Aal::capptr_bound<void, capptr::bounds::AllocFull>(
p.as_void(), rsize))),
key,
NO_KEY_TWEAK,
entropy);
p = pointer_offset(p, rsize);
} while (p < slab_end);
Expand All @@ -271,7 +273,7 @@ namespace snmalloc
{
auto& key = entropy.get_free_list_key();
freelist::Iter<> fl;
auto more = meta->free_queue.close(fl, key);
auto more = meta->free_queue.close(fl, key, NO_KEY_TWEAK);
UNUSED(more);
auto local_state = backend_state_ptr();
auto domesticate = [local_state](freelist::QueuePtr p)
Expand Down Expand Up @@ -303,7 +305,7 @@ namespace snmalloc

if (more > 0)
{
auto no_more = meta->free_queue.close(fl, key);
auto no_more = meta->free_queue.close(fl, key, NO_KEY_TWEAK);
SNMALLOC_ASSERT(no_more == 0);
UNUSED(no_more);

Expand Down Expand Up @@ -348,7 +350,8 @@ namespace snmalloc
{
if (check_slabs)
{
meta->free_queue.validate(entropy.get_free_list_key(), domesticate);
meta->free_queue.validate(
entropy.get_free_list_key(), NO_KEY_TWEAK, domesticate);
}
return;
}
Expand Down Expand Up @@ -709,7 +712,7 @@ namespace snmalloc
auto& key = entropy.get_free_list_key();

// Update the head and the next pointer in the free list.
meta->free_queue.add(cp, key, entropy);
meta->free_queue.add(cp, key, NO_KEY_TWEAK, entropy);

return SNMALLOC_LIKELY(!meta->return_object());
}
Expand Down Expand Up @@ -849,19 +852,14 @@ namespace snmalloc

if (destroy_queue)
{
auto p_wild = message_queue().destroy();
auto p_tame = domesticate(p_wild);

while (p_tame != nullptr)
{
auto cb = [this](capptr::Alloc<void> p) {
bool need_post = true; // Always going to post, so ignore.
auto n_tame =
p_tame->atomic_read_next(RemoteAllocator::key_global, domesticate);
const PagemapEntry& entry =
Config::Backend::get_metaentry(snmalloc::address_cast(p_tame));
handle_dealloc_remote(entry, p_tame.as_void(), need_post);
p_tame = n_tame;
}
Config::Backend::get_metaentry(snmalloc::address_cast(p));
handle_dealloc_remote(entry, p.as_void(), need_post);
};

message_queue().destroy_and_iterate(domesticate, cb);
}
else
{
Expand All @@ -886,7 +884,8 @@ namespace snmalloc
BackendSlabMetadata* meta) SNMALLOC_FAST_PATH_LAMBDA {
if (!meta->is_large())
{
meta->free_queue.validate(entropy.get_free_list_key(), domesticate);
meta->free_queue.validate(
entropy.get_free_list_key(), NO_KEY_TWEAK, domesticate);
}
});

Expand Down
Loading
Loading