https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105251

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
mongodb is using these two values incorrectly and even misunderstanding what
they mean.

hardware_constructive_interference_size means the Minimum offset between two
objects which will avoid false sharing. So if you have two objects that are
that distant apart, then there will be NO false sharing at all (some offsets
smaller might also work too but it depends on the HW which is run on).

While hardware_constructive_interference_size says the maxium offset between
two obejcts which will promote true sharing.

That is if the two objects are within that alignment, there is a guarantee that
there will be sharing.

So if they want to guarantee true sharing, then they need to have it as aligned
to hardware_constructive_interference_size and make sure the size is smaller
than hardware_constructive_interference_size .

So In this case Together should be aligned to
hardware_constructive_interference_size .

The other CacheAligned cases need to be looked into make sure they are using
the correct values too. Depending on what they are trying to do.

Reply via email to