Re: [PATCH 0/4] Allow persistent memory to be used like normal RAM

From: Dave Hansen
Date: Thu Jan 17 2019 - 17:50:19 EST


On 1/17/19 8:29 AM, Jeff Moyer wrote:
>> Persistent memory is cool. But, currently, you have to rewrite
>> your applications to use it. Wouldn't it be cool if you could
>> just have it show up in your system like normal RAM and get to
>> it like a slow blob of memory? Well... have I got the patch
>> series for you!
> So, isn't that what memory mode is for?
> https://itpeernetwork.intel.com/intel-optane-dc-persistent-memory-operating-modes/
>
> Why do we need this code in the kernel?

So, my bad for not mentioning memory mode. This patch set existed
before we could talk about it publicly, so it simply ignores its
existence. It's a pretty glaring omissions at this point, sorry.

I'll add this to the patches, but here are a few reasons you might want
this instead of memory mode:
1. Memory mode is all-or-nothing. Either 100% of your persistent memory
is used for memory mode, or nothing is. With this set, you can
(theoretically) have very granular (128MB) assignment of PMEM to
either volatile or persistent uses. We have a few practical matters
to fix to get us down to that 128MB value, but we can get there.
2. The capacity of memory mode is the size of your persistent memory.
DRAM capacity is "lost" because it is used for cache. With this,
you get PMEM+DRAM capacity for memory.
3. DRAM acts as a cache with memory mode, and caches can lead to
unpredictable latencies. Since memory mode is all-or-nothing, your
entire memory space is exposed to these unpredictable latencies.
This solution lets you guarantee DRAM latencies if you need them.
4. The new "tier" of memory is exposed to software. That means that you
can build tiered applications or infrastructure. A cloud provider
could sell cheaper VMs that use more PMEM and more expensive ones
that use DRAM. That's impossible with memory mode.

Don't take this as criticism of memory mode. Memory mode is awesome,
and doesn't strictly require *any* software changes (we have software
changes proposed for optimizing it though). It has tons of other
advantages over *this* approach. Basically, they are complementary
enough that we think both can live side-by-side.