Skip to content

Commit

Permalink
Speedup walking the free-list (microsoft#4036)
Browse files Browse the repository at this point in the history
* Speedup walking the free-list

Signed-off-by: Alan Jowett <[email protected]>

* Switch to higher level abstraction for prefetch

Signed-off-by: Alan Jowett <[email protected]>

---------

Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan-Jowett and Alan Jowett authored Nov 23, 2024
1 parent 726a856 commit 5f5c451
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions libs/runtime/ebpf_epoch.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ _ebpf_epoch_release_free_list(_Inout_ ebpf_epoch_cpu_entry_t* cpu_entry, int64_t
header = CONTAINING_RECORD(entry, ebpf_epoch_allocation_header_t, list_entry);
if (header->freed_epoch <= released_epoch) {
ebpf_list_remove_entry(entry);
PrefetchForWrite(entry->Flink->Flink);
switch (header->entry_type) {
case EBPF_EPOCH_ALLOCATION_MEMORY:
ebpf_free(header);
Expand Down
5 changes: 1 addition & 4 deletions libs/runtime/ebpf_hash_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,7 @@ ebpf_hash_table_find(_In_ const ebpf_hash_table_t* hash_table, _In_ const uint8_
goto Done;
}

#if defined(_M_X64)
// Prefetch the data on the assumption that it will be used by the caller soon.
_mm_prefetch((const char*)data, _MM_HINT_T0);
#endif
PrefetchForWrite(data);

*value = data;
if (hash_table->notification_callback) {
Expand Down

0 comments on commit 5f5c451

Please sign in to comment.