Opened 5 years ago

Last modified 5 years ago

#13130 new Bugs

BOOST_LOCKFREE_CACHELINE_BYTES value is incorrect on s390x

Reported by: mike.munday@… Owned by: timblechmann
Milestone: To Be Determined Component: lockfree
Version: Boost 1.63.0 Severity: Optimization
Keywords: Cc:

Description

The file include/boost/lockfree/detail/prefix.hpp contains the following code snippet:

// PowerPC caches support 128-byte cache lines.
#if defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
    #define BOOST_LOCKFREE_CACHELINE_BYTES 128
#else
    #define BOOST_LOCKFREE_CACHELINE_BYTES 64
#endif

This sets the cache line size on s390x to 64 bytes. This is incorrect, the correct size is 256 bytes. To fix we just need to add an extra #elif checking for the s390/ s390x compiler-defined macros.

Change History (2)

comment:1 by mike.munday@…, 5 years ago

Sorry, I messed up the formatting of the compiler-defined macros above, they are __s390__ and __s390x__.

comment:2 by mike.munday@…, 5 years ago

This has been fixed by 6bee2bf if someone wants to close this.

Note: See TracTickets for help on using tickets.