Messages in this thread | | | From | Jeff Moyer <> | Subject | Re: [RFC PATCH rdma-next 01/10] RDMA: mr: Introduce is_pmem | Date | Thu, 27 Jan 2022 17:30:08 -0500 |
| |
"Li, Zhijian" <lizhijian@cn.fujitsu.com> writes:
> Copied to nvdimm list > > Thanks > > Zhijian > > > on 2022/1/6 14:12, Li Zhijian wrote: >> >> Add Dan to the party :) >> >> May i know whether there is any existing APIs to check whether >> a va/page backs to a nvdimm/pmem ?
I don't know of one. You could try walk_system_ram_range looking for IORES_DESC_PERSISTENT_MEMORY, but that's not very efficient.
>>> You need to get Dan to check this out, but I'm pretty sure this should >>> be more like this: >>> >>> if (is_zone_device_page(page) && page->pgmap->type == >>> MEMORY_DEVICE_FS_DAX)
You forgot MEMORY_DEVICE_GENERIC. However, this doesn't guarantee the memory belongs to persistent memory, only that it is direct access capable.
Dan, any ideas?
-Jeff
| |