diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 667238b0bace..ae7faf92a146 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -88,6 +88,10 @@ MALLOC_DECLARE(M_NVME); #define NVME_TIMEOUT_IN_SEC (30) +#ifndef CACHE_LINE_SIZE +#define CACHE_LINE_SIZE (64) +#endif + struct nvme_prp_list { uint64_t prp[NVME_MAX_PRP_LIST_ENTRIES]; SLIST_ENTRY(nvme_prp_list) slist; @@ -131,8 +135,6 @@ struct nvme_qpair { int64_t num_cmds; - struct mtx lock; - struct nvme_command *cmd; struct nvme_completion *cpl; @@ -152,7 +154,10 @@ struct nvme_qpair { struct nvme_tracker **act_tr; SLIST_HEAD(, nvme_prp_list) free_prp_list; -}; + + struct mtx lock __aligned(CACHE_LINE_SIZE); + +} __aligned(CACHE_LINE_SIZE); struct nvme_namespace {