]> git.proxmox.com Git - mirror_ovs.git/commit
util: Make xmalloc_cacheline() allocate full cachelines.
authorBen Pfaff <blp@ovn.org>
Tue, 28 Nov 2017 18:28:33 +0000 (10:28 -0800)
committerBen Pfaff <blp@ovn.org>
Wed, 29 Nov 2017 17:07:31 +0000 (09:07 -0800)
commitee3ac719f204bd5827aaf7f9237c8f7c1cdb60c3
tree928024164d9e7c6bbc3deaa7d6649e48b6cb0340
parent951d79e638ecdb3b1dcd19df1adb2ff91fe61af8
util: Make xmalloc_cacheline() allocate full cachelines.

Until now, xmalloc_cacheline() has provided its caller memory that does not
share a cache line, but when posix_memalign() is not available it did not
provide a full cache line; instead, it returned memory that was offset 8
bytes into a cache line.  This makes it hard for clients to design
structures to be cache line-aligned.  This commit changes
xmalloc_cacheline() to always return a full cache line instead of memory
offset into one.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Bhanuprakash Bodireddy <Bhanuprakash.bodireddy@intel.com>
Tested-by: Bhanuprakash Bodireddy <Bhanuprakash.bodireddy@intel.com>
Tested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341362.html
lib/util.c