Skip to content

Commit 4c806b8

Browse files
kvaneeshdjbw
authored andcommitted
libnvdimm/region: Enable MAP_SYNC for volatile regions
Some environments want to use a host tmpfs/ramdisk to back guest pmem. While the data is not persisted relative to the host it *is* persisted relative to guest crashes / reboots. The guest is free to use dax and MAP_SYNC to keep filesystem metadata consistent with dax accesses without requiring guest fsync(). The guest can also observe that the region is volatile and skip cache flushing as global visibility is enough to "persist" data relative to the host staying alive over guest reset events. Signed-off-by: Aneesh Kumar K.V <[email protected]> Reviewed-by: Pankaj Gupta <[email protected]> Link: https://lore.kernel.org/r/[email protected] [djbw: reword the changelog] Signed-off-by: Dan Williams <[email protected]>
1 parent 674f31a commit 4c806b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/nvdimm/region_devs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,9 @@ EXPORT_SYMBOL_GPL(nvdimm_has_cache);
11681168

11691169
bool is_nvdimm_sync(struct nd_region *nd_region)
11701170
{
1171+
if (is_nd_volatile(&nd_region->dev))
1172+
return true;
1173+
11711174
return is_nd_pmem(&nd_region->dev) &&
11721175
!test_bit(ND_REGION_ASYNC, &nd_region->flags);
11731176
}

0 commit comments

Comments
 (0)