ref count alignment

Move ref counts to their own cacheline - otherwise they pollute and cause
false sharing to fields nearby and cause a lot of cache bouncing between
physical CPUs.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
This commit is contained in:
Kozlowski Mateusz 2021-03-12 15:28:02 +01:00
parent fd2fd335a0
commit 642527d72a
2 changed files with 4 additions and 4 deletions

View File

@ -91,12 +91,12 @@ struct ocf_cache {
struct {
/* cache get/put counter */
struct ocf_refcnt cache;
struct ocf_refcnt cache __attribute__((aligned(64)));
/* # of requests potentially dirtying cachelines */
struct ocf_refcnt dirty;
struct ocf_refcnt dirty __attribute__((aligned(64)));
/* # of requests accessing attached metadata, excluding
* management reqs */
struct ocf_refcnt metadata;
struct ocf_refcnt metadata __attribute__((aligned(64)));
} refcnt;
ocf_pipeline_t stop_pipeline;

View File

@ -32,7 +32,7 @@ struct ocf_volume {
unsigned discard_zeroes:1;
/* true if reading discarded pages returns 0 */
} features;
struct ocf_refcnt refcnt;
struct ocf_refcnt refcnt __attribute__((aligned(64)));
} __attribute__((aligned(64)));
int ocf_volume_type_init(struct ocf_volume_type **type,