[SERVER-38462] Evaluate safety of abseil's unaligned access mechanisms Created: 07/Dec/18 Updated: 29/Oct/23 Resolved: 07/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.7 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Dev Tools 2018-12-31, Dev Tools 2019-01-14 |
| Participants: |
| Description |
|
Abseil has some fun deciding how and when to use unaligned operations. Notably, it does them, but then pretends it doesn't if it knows certain sanitizers are active. Otherwise, it tries some hardware assumptions and then falls back to memcpy. Of course memcpy is actually the right answer, in a strict sense. We should take a look to decide whether we trust abseils choices here or whether we want to force to memcpy. |
| Comments |
| Comment by Githook User [ 07/Jan/19 ] | |||||||||||
|
Author: {'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}Message: | |||||||||||
| Comment by Githook User [ 20/Dec/18 ] | |||||||||||
|
Author: {'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}Message: | |||||||||||
| Comment by Billy Donahue [ 20/Dec/18 ] | |||||||||||
|
Benchmark on the effect of ABSL_FORCE_ALIGNED_ACCESS on the insertion speed of Flat and Node hash maps. | |||||||||||
| Comment by Githook User [ 19/Dec/18 ] | |||||||||||
|
Author: {'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}Message:
add forgotton absl new files Revert " This reverts commit f7f51c062ceb23d6b5395d4fce75b3e4e0b9ddff. | |||||||||||
| Comment by Billy Donahue [ 19/Dec/18 ] | |||||||||||
|
Code review url: https://mongodbcr.appspot.com/230510001 | |||||||||||
| Comment by Billy Donahue [ 19/Dec/18 ] | |||||||||||
|
It should be "force aligned access". They have a macro with a similar meaning that is misnamed ABSL_INTERNAL_NEED_ALIGNED_LOADS I was copying its bad name. But I shouldn't. It's an internal name anyway and mine isn't. | |||||||||||
| Comment by Andrew Morrow (Inactive) [ 19/Dec/18 ] | |||||||||||
|
I like that idea. Lets try to propose it to upstream too. Is it just for loads, or stores too? ABSL_FORCE_ALIGNED_ACCESS? | |||||||||||
| Comment by Billy Donahue [ 18/Dec/18 ] | |||||||||||
|
I'm going to add in an ABSL_FORCE_ALIGNED_LOADS macro to bypass the optimizations for the common case that one cares more about portable correctness than about missed optimization opportunities due to late-stage inlining. | |||||||||||
| Comment by Billy Donahue [ 18/Dec/18 ] | |||||||||||
|
I'm looking at absl/base/internal/unaligned_access.h. It includes the following note:
|