Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1666313
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 13/14] libnvdimm, pmem: gate cache management on QUEUE_FLAG_WC in pmem_dax_flush() |
| Date | 2017-06-15 01:20 +0200 |
| Message-ID | <tSpJU-37v-19@gated-at.bofh.it> (permalink) |
| References | <tQyRk-6b1-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Some platforms arrange for cpu caches to be flushed on power-fail. On
those platforms there is no requirement that the kernel track and flush
potentially dirty cache lines. Given that we still insert entries into
the radix for locking purposes this patch only disables the cache flush
loop, not the dirty tracking.
Userspace can override the default cache setting via the block device
queue "write_cache" attribute in sysfs.
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>
Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Changes since v3:
* move the check of QUEUE_FLAG_WC into the pmem driver directly (Jan)
drivers/nvdimm/pmem.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 06f6c27ec1e9..49938b246a7b 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -244,7 +244,16 @@ static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
static void pmem_dax_flush(struct dax_device *dax_dev, pgoff_t pgoff,
void *addr, size_t size)
{
- arch_wb_cache_pmem(addr, size);
+ struct pmem_device *pmem = dax_get_private(dax_dev);
+ struct gendisk *disk = pmem->disk;
+ struct request_queue *q = disk->queue;
+
+ /*
+ * Only perform cache management when the queue has caching
+ * enabled.
+ */
+ if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ arch_wb_cache_pmem(addr, size);
}
static const struct dax_operations pmem_dax_ops = {
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Dan Williams <dan.j.williams@intel.com> - 2017-06-09 22:40 +0200
Re: [PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Jan Kara <jack@suse.cz> - 2017-06-14 12:50 +0200
Re: [PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Dan Williams <dan.j.williams@intel.com> - 2017-06-14 18:50 +0200
[PATCH v4 13/14] libnvdimm, pmem: gate cache management on QUEUE_FLAG_WC in pmem_dax_flush() Dan Williams <dan.j.williams@intel.com> - 2017-06-15 01:20 +0200
Re: [PATCH v4 13/14] libnvdimm, pmem: gate cache management on QUEUE_FLAG_WC in pmem_dax_flush() Jan Kara <jack@suse.cz> - 2017-06-15 10:10 +0200
Re: [PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Christoph Hellwig <hch@lst.de> - 2017-06-18 10:50 +0200
Re: [PATCH v3 13/14] filesystem-dax: gate calls to dax_flush() on QUEUE_FLAG_WC Dan Williams <dan.j.williams@intel.com> - 2017-06-19 04:10 +0200
csiph-web