[dm-devel] Persistent memory interface
Dan Williams
dan.j.williams at intel.com
Fri Jun 19 17:35:11 UTC 2015
On Fri, Jun 19, 2015 at 9:33 AM, Mikulas Patocka <mpatocka at redhat.com> wrote:
> Hi
>
> I looked at the new the persistent memory block device driver
> (drivers/block/pmem.c and arch/x86/kernel/pmem.c) and it seems that the
> interface between them is incorrect.
>
> If I want to use persistent memory in another driver, for a different
> purpose, how can I make sure that that drivers/block/pmem.c doesn't attach
> to this piece of memory and export it? It seems not possible.
> drivers/block/pmem.c attaches to everything without regard that there may
> be other users of persistent memory.
Simply partition the pmem device however you see fit and then
blkdev_get_by_path(<dev>, FMODE_EXCL, <holder>) the resulting
partition(s).
See the BTT infrastructure for how to autodetect and re-assemble this
allocation at sub-system init time:
https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git/tree/drivers/nvdimm/btt_devs.c?h=libnvdimm-pending#n450
More information about the dm-devel
mailing list