Skip to content

Conversation

lnkuiper
Copy link
Contributor

@lnkuiper lnkuiper commented Sep 30, 2024

Apparently ARM64v8 uses 52, not 48 bits for the pointer (not all versions of ARM64v8, but just some). We could also #ifdef our way around this but this seems fine. It reduces the effectiveness of the salt by 16x sadly, but it's still reduces the chance of having to chase the pointer even when keys are different by 4096x (was 65536x).

Fixes #14140

@hannes hannes merged commit 92c65a4 into duckdb:main Oct 2, 2024
40 checks passed
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Oct 16, 2024
Less salt (duckdb/duckdb#14173)
[Python Dev] Make sure the GIL is released when the connection+db are being shut down (duckdb/duckdb#14113)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Oct 16, 2024
Less salt (duckdb/duckdb#14173)
[Python Dev] Make sure the GIL is released when the connection+db are being shut down (duckdb/duckdb#14113)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
@lnkuiper lnkuiper mentioned this pull request Oct 28, 2024
Mytherin added a commit that referenced this pull request Oct 29, 2024
Fixes #14389 and reverts #14173
(bringing back the salt).

Although I don't think this should affect correctness (from
cppreference.com):
> When a compare-and-exchange is in a loop, the weak version will yield
better performance on some platforms. When a weak compare-and-exchange
would require a loop and a strong one would not, the strong one is
preferable.

This gave us correctness issues with older GCC versions (< 10.x) on
ARM64. We rarely use CAS operations, so this isn't a big diff. I've
added `std::memory_order` to improve the performance (copying the usage
in `concurrentqueue.h`). Since it is difficult to programmatically
disable "incorrect" usage, I've added a comment in `atomic.hpp` that
describes the issue.

I've also changed usage of `MetadataPointer` to a const reference since
older GCC versions were throwing a warning.
@lnkuiper lnkuiper deleted the less_salt branch April 14, 2025 09:12
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.

INNER JOIN returns inconsistent results
2 participants