HI Andy,
Thanks for your support on this. Let me put a bit more around what I am trying to do, to see if it changes your opinion that it is a mismatch...
I am building a cache for storage -- conceptually, a cache above a block device to keep a working set available at reduced latency and improved throughput. The cache is intended to be large (a significant fraction of the block device, perhaps a handful of TB) and non-volatile (prototyping will be based on Intel P3700 NVMe SSDs). Along with the cached data, some small amount of metadata must also persist.
I would find it convenient to address this storage as memory - and the size of the cache lines (a few MB at most) is easily manageable in memory, the processors involved support a 48-bit-sized virtual address space, so mapping a large device doesn't present a problem, and so on. The stars seem aligned.
Moreover, the design of the cache is such that I'll need transactions -- the design of the NVM library's transactions is pretty much exactly what I need.
Occasionally (;-}) I'll want to allocate a "new" cache line from a ready-to-use pool. That pool is produced by evictions (based on lack of access). That's where my desire to TRIM comes up. When I evict the cache line, the data is irrelevant, no reason for me to go through a garbage collection process -- my modelling suggests that this may improve the performance and extend the life of the flash-based devices that I use.