summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/nfit.h
diff options
context:
space:
mode:
authorRoss Zwisler <ross.zwisler@linux.intel.com>2015-08-27 15:14:20 -0400
committerDan Williams <dan.j.williams@intel.com>2015-08-27 19:38:28 -0400
commit67a3e8fe90156d41cd480d3dfbb40f3bc007c262 (patch)
treefcd0fa657c6424ba874e46dfc5349cb55f630f6b /drivers/acpi/nfit.h
parente2e05394e4a3420dab96f728df4531893494e15d (diff)
nd_blk: change aperture mapping from WC to WB
This should result in a pretty sizeable performance gain for reads. For rough comparison I did some simple read testing using PMEM to compare reads of write combining (WC) mappings vs write-back (WB). This was done on a random lab machine. PMEM reads from a write combining mapping: # dd of=/dev/null if=/dev/pmem0 bs=4096 count=100000 100000+0 records in 100000+0 records out 409600000 bytes (410 MB) copied, 9.2855 s, 44.1 MB/s PMEM reads from a write-back mapping: # dd of=/dev/null if=/dev/pmem0 bs=4096 count=1000000 1000000+0 records in 1000000+0 records out 4096000000 bytes (4.1 GB) copied, 3.44034 s, 1.2 GB/s To be able to safely support a write-back aperture I needed to add support for the "read flush" _DSM flag, as outlined in the DSM spec: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf This flag tells the ND BLK driver that it needs to flush the cache lines associated with the aperture after the aperture is moved but before any new data is read. This ensures that any stale cache lines from the previous contents of the aperture will be discarded from the processor cache, and the new data will be read properly from the DIMM. We know that the cache lines are clean and will be discarded without any writeback because either a) the previous aperture operation was a read, and we never modified the contents of the aperture, or b) the previous aperture operation was a write and we must have written back the dirtied contents of the aperture to the DIMM before the I/O was completed. In order to add support for the "read flush" flag I needed to add a generic routine to invalidate cache lines, mmio_flush_range(). This is protected by the ARCH_HAS_MMIO_FLUSH Kconfig variable, and is currently only supported on x86. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit.h')
-rw-r--r--drivers/acpi/nfit.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index f2c2bb751882..7e740156b9c2 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -41,6 +41,7 @@ enum nfit_uuids {
41}; 41};
42 42
43enum { 43enum {
44 ND_BLK_READ_FLUSH = 1,
44 ND_BLK_DCR_LATCH = 2, 45 ND_BLK_DCR_LATCH = 2,
45}; 46};
46 47
@@ -117,12 +118,16 @@ enum nd_blk_mmio_selector {
117 DCR, 118 DCR,
118}; 119};
119 120
121struct nd_blk_addr {
122 union {
123 void __iomem *base;
124 void __pmem *aperture;
125 };
126};
127
120struct nfit_blk { 128struct nfit_blk {
121 struct nfit_blk_mmio { 129 struct nfit_blk_mmio {
122 union { 130 struct nd_blk_addr addr;
123 void __iomem *base;
124 void __pmem *aperture;
125 };
126 u64 size; 131 u64 size;
127 u64 base_offset; 132 u64 base_offset;
128 u32 line_size; 133 u32 line_size;
@@ -149,7 +154,8 @@ struct nfit_spa_mapping {
149 struct acpi_nfit_system_address *spa; 154 struct acpi_nfit_system_address *spa;
150 struct list_head list; 155 struct list_head list;
151 struct kref kref; 156 struct kref kref;
152 void __iomem *iomem; 157 enum spa_map_type type;
158 struct nd_blk_addr addr;
153}; 159};
154 160
155static inline struct nfit_spa_mapping *to_spa_map(struct kref *kref) 161static inline struct nfit_spa_mapping *to_spa_map(struct kref *kref)