On Fri, Dec 01, 2017 at 09:13:08AM +0300, Ilya Maximets wrote: > On 30.11.2017 20:42, Ben Pfaff wrote: > > On Thu, Nov 30, 2017 at 03:55:03PM +0300, Ilya Maximets wrote: > >> Current implementation of manual padding inside struct cmap_bucket > >> doesn't work for some cacheline sizes. For example, if CACHE_LINE_SIZE > >> equals to 128, compiler adds an additional 8 bytes: 4 bytes between > >> 'hashes' and 'nodes' and 4 bytes after the manual 'pad'. This leads to > >> build time assertion, because sizeof(struct cmap_bucket) == 136. > >> > >> Fix that by using PADDED_MEMBERS macro, which will handle all the > >> unexpected compiler paddings. > >> This is safe because we still have build time assert for the structure > >> size. Other possible solution is to pack the structure, but the padding > >> marco looks better and matches the other code. > >> > >> Signed-off-by: Ilya Maximets <[email protected]> > > > > Thanks, applied to master. > > > > I've heard a few mentions of non-64-byte cache lines lately. Is this > > hypothetical or are you working with a system that has larger (or > > smaller) cache lines? > > I have an ARMv8 machine with 128B cache line size for testing purposes. > > There are other platforms like Cavium OCTEON (MIPS based) that has 128B cache > line size. So, this is not a unique phenomenon.
Thanks, I did not know about these cases. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
