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

chore: add Dash::Prefetch function #4476

Merged
merged 2 commits into from
Jan 19, 2025
Merged

chore: add Dash::Prefetch function #4476

merged 2 commits into from
Jan 19, 2025

Conversation

romange
Copy link
Collaborator

@romange romange commented Jan 19, 2025

It's not being used at this time.

It's not being used at this time.
@romange romange requested a review from BorysTheDev January 19, 2025 11:52
@romange romange requested a review from BorysTheDev January 19, 2025 12:58
const Bucket& target = bucket_[bidx];

// Prefetch the home bucket that might hold the key with high probability.
__builtin_prefetch(&target, 0, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the bucket size? if the size of the bucket is more than the cache line maybe it will be better to load the whole bucket

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the bucket size is dependent on the key/value size but the bucket metadata is located at the beginning. we use the metadata/fingerprints to do the initial scan.

Copy link
Contributor

@BorysTheDev BorysTheDev Jan 19, 2025

Choose a reason for hiding this comment

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

Could you clarify what metadata do you want to read, because to my mind it's more than 64 bytes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SlotBitmap<NUM_SLOTS> slotb_;  // allocation bitmap + pointer bitmap + counter

  /*only use the first 14 bytes, can be accelerated by
    SSE instruction,0-13 for finger, 14-17 for overflowed*/
  FpArray finger_arr_;
  StashFpArray stash_arr_;

  uint8_t stash_busy_ = 0;  // kStashFpLen+1 bits are used
  uint8_t stash_pos_ = 0;   // 4x2 bits for pointing to stash bucket.

BucketBase<NUM_SLOTS, NUM_OVR>::CompareFP is the function that usually hits a cold memory

@romange romange requested a review from BorysTheDev January 19, 2025 16:48
@romange romange merged commit a936dfe into main Jan 19, 2025
9 checks passed
@romange romange deleted the Pr1 branch January 19, 2025 18:07
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