diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-06-09 19:46:50 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-06-29 19:29:50 +0300 |
commit | 0b277961f4484fb3f142caaa1dd1748cb0b2cbee (patch) | |
tree | c3ba6190530a8732a64df8e2dba2c6028d36a2eb /drivers/nvdimm/region_devs.c | |
parent | 6e0c90d691cd5d90569f5918ab03eb76c81f9c6e (diff) | |
download | linux-0b277961f4484fb3f142caaa1dd1748cb0b2cbee.tar.xz |
libnvdimm, pmem: disable dax flushing when pmem is fronting a volatile region
The pmem driver attaches to both persistent and volatile memory ranges
advertised by the ACPI NFIT. When the region is volatile it is redundant
to spend cycles flushing caches at fsync(). Check if the hosting region
is volatile and do not set dax_write_cache() if it is.
Cc: Jan Kara <jack@suse.cz>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/region_devs.c')
-rw-r--r-- | drivers/nvdimm/region_devs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index 53a64a16aba4..0c3b089b280a 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -1060,6 +1060,12 @@ int nvdimm_has_flush(struct nd_region *nd_region) } EXPORT_SYMBOL_GPL(nvdimm_has_flush); +int nvdimm_has_cache(struct nd_region *nd_region) +{ + return is_nd_pmem(&nd_region->dev); +} +EXPORT_SYMBOL_GPL(nvdimm_has_cache); + void __exit nd_region_devs_exit(void) { ida_destroy(®ion_ida); |