linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix BTT data corruptions after crash
@ 2016-01-28 18:12 Toshi Kani
  2016-01-28 18:12 ` [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy Toshi Kani
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Toshi Kani @ 2016-01-28 18:12 UTC (permalink / raw)
  To: tglx, mingo, hpa, bp, dan.j.williams
  Cc: ross.zwisler, vishal.l.verma, micah.parrish, brian.boylston, x86,
	linux-nvdimm, linux-kernel

Data corruption issues were observed in tests which initiated a system
crash/reset while accessing BTT devices.  This problem is reproducible.

The BTT driver calls pmem_rw_bytes() to update data in pmem devices.
This interface calls __copy_user_nocache(), which uses non-temporal
stores so that the stores to pmem are persistent.

__copy_user_nocache() uses non-temporal stores when a request size is
8 bytes or larger (and is aligned by 8 bytes).  The BTT driver updates
the BTT map table, which entry size is 4 bytes.  Therefore, updates to
the map table entries remain cached, and are not written to pmem after
a crash.  Since the BTT driver makes previous blocks free and uses them
for subsequent writes, the map table ends up pointing to blocks allocated
for other LBAs after a crash.

Patch 1 extends __copy_user_nocache() to use non-temporal store for
4 byte copy.  This patch fixes the BTT data corruption issue.

Patch 2 changes arch_memcpy_to_pmem() to flush processor caches when
a request is not naturally aligned or is less than 4 bytes.  This is
defensive change.

---
Toshi Kani (2):
 1/2 x86/lib/copy_user_64.S: Handle 4-byte uncached copy
 2/2 pmem: Flush cache on unaligned request

---
 arch/x86/include/asm/pmem.h | 11 +++++++++++
 arch/x86/lib/copy_user_64.S | 44 +++++++++++++++++++++++++++++++++-----------
 2 files changed, 44 insertions(+), 11 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-01 19:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-28 18:12 [PATCH 0/2] Fix BTT data corruptions after crash Toshi Kani
2016-01-28 18:12 ` [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy Toshi Kani
2016-01-29  8:27   ` Ingo Molnar
2016-01-29 14:56     ` Toshi Kani
2016-01-28 18:12 ` [PATCH 2/2] pmem: Flush cache on unaligned request Toshi Kani
2016-01-28 20:12 ` [PATCH 0/2] Fix BTT data corruptions after crash Dan Williams
2016-01-28 20:43   ` Toshi Kani
2016-01-30 17:44     ` Dan Williams
2016-02-01 19:50       ` Toshi Kani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).