2015-07-10 14:07:03 -04:00
ldflags-y += --wrap=ioremap_wc
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>
2015-08-27 13:14:20 -06:00
ldflags-y += --wrap=memremap
2015-07-10 14:07:03 -04:00
ldflags-y += --wrap=devm_ioremap_nocache
2015-08-10 23:07:08 -04:00
ldflags-y += --wrap=devm_memremap
2015-08-01 02:16:37 -04:00
ldflags-y += --wrap=devm_memunmap
2015-06-17 17:23:32 -04:00
ldflags-y += --wrap=ioremap_nocache
ldflags-y += --wrap=iounmap
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>
2015-08-27 13:14:20 -06:00
ldflags-y += --wrap=memunmap
2015-08-10 23:07:08 -04:00
ldflags-y += --wrap=__devm_request_region
2016-03-22 00:22:16 -07:00
ldflags-y += --wrap=__devm_release_region
2015-06-17 17:23:32 -04:00
ldflags-y += --wrap=__request_region
ldflags-y += --wrap=__release_region
2015-12-15 00:34:21 -08:00
ldflags-y += --wrap=devm_memremap_pages
2016-06-15 20:34:17 -07:00
ldflags-y += --wrap=insert_resource
ldflags-y += --wrap=remove_resource
2015-06-17 17:23:32 -04:00
DRIVERS := ../../../drivers
NVDIMM_SRC := $(DRIVERS)/nvdimm
ACPI_SRC := $(DRIVERS)/acpi
2016-05-18 09:15:08 -07:00
DAX_SRC := $(DRIVERS)/dax
2016-06-17 11:08:06 -07:00
ccflags-y := -I$(src)/$(NVDIMM_SRC)/
2015-06-17 17:23:32 -04:00
obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o
obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o
obj-$(CONFIG_ND_BTT) += nd_btt.o
obj-$(CONFIG_ND_BLK) += nd_blk.o
2015-08-19 00:34:34 -04:00
obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o
2015-06-17 17:23:32 -04:00
obj-$(CONFIG_ACPI_NFIT) += nfit.o
2016-05-18 09:15:08 -07:00
obj-$(CONFIG_DEV_DAX) += dax.o
obj-$(CONFIG_DEV_DAX_PMEM) += dax_pmem.o
2015-06-17 17:23:32 -04:00
nfit-y := $(ACPI_SRC)/nfit.o
nfit-y += config_check.o
nd_pmem-y := $(NVDIMM_SRC)/pmem.o
2016-06-17 11:08:06 -07:00
nd_pmem-y += pmem-dax.o
2015-06-17 17:23:32 -04:00
nd_pmem-y += config_check.o
nd_btt-y := $(NVDIMM_SRC)/btt.o
nd_btt-y += config_check.o
nd_blk-y := $(NVDIMM_SRC)/blk.o
nd_blk-y += config_check.o
2015-08-19 00:34:34 -04:00
nd_e820-y := $(NVDIMM_SRC)/e820.o
nd_e820-y += config_check.o
2016-05-18 09:15:08 -07:00
dax-y := $(DAX_SRC)/dax.o
dax-y += config_check.o
dax_pmem-y := $(DAX_SRC)/pmem.o
dax_pmem-y += config_check.o
2015-06-17 17:23:32 -04:00
libnvdimm-y := $(NVDIMM_SRC)/core.o
libnvdimm-y += $(NVDIMM_SRC)/bus.o
libnvdimm-y += $(NVDIMM_SRC)/dimm_devs.o
libnvdimm-y += $(NVDIMM_SRC)/dimm.o
libnvdimm-y += $(NVDIMM_SRC)/region_devs.o
libnvdimm-y += $(NVDIMM_SRC)/region.o
libnvdimm-y += $(NVDIMM_SRC)/namespace_devs.o
libnvdimm-y += $(NVDIMM_SRC)/label.o
2015-07-30 17:57:47 -04:00
libnvdimm-$(CONFIG_ND_CLAIM) += $(NVDIMM_SRC)/claim.o
2015-06-17 17:23:32 -04:00
libnvdimm-$(CONFIG_BTT) += $(NVDIMM_SRC)/btt_devs.o
2015-07-30 17:57:47 -04:00
libnvdimm-$(CONFIG_NVDIMM_PFN) += $(NVDIMM_SRC)/pfn_devs.o
2016-03-11 10:15:36 -08:00
libnvdimm-$(CONFIG_NVDIMM_DAX) += $(NVDIMM_SRC)/dax_devs.o
2015-06-17 17:23:32 -04:00
libnvdimm-y += config_check.o
obj-m += test/