dm writecache: improve performance on DDR persistent memory (Optane)
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 29 Apr 2020 16:30:03 +0000 (12:30 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 15 May 2020 14:29:36 +0000 (10:29 -0400)
commit48338daaa00e6137a43fa5d0e54b763aa34f450b
tree8a3b7250121a73df9de065be338d582f192c9632
parent499c18045eab16656ef4159c35b05865038f9f25
dm writecache: improve performance on DDR persistent memory (Optane)

When testing the dm-writecache target on a real DDR persistent memory
(Intel Optane), it turned out that explicit cache flushing using the
clflushopt instruction performs better than non-temporal stores for
block sizes 1k, 2k and 4k.

The dm-writecache target is singlethreaded (all the copying is done
while holding the writecache lock), so it benefits from clwb, see:
http://lore.kernel.org/r/alpine.LRH.2.02.2004160411460.7833@file01.intranet.prod.int.rdu2.redhat.com

Add a new function memcpy_flushcache_optimized() that tests if
clflushopt is present - and if it is, we use it instead of
memcpy_flushcache.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c