Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots do not work on DAX mmap()'d files without commenting out lines mm/memory.c:1549-1552 #107

Open
derrickgreenspan opened this issue Jun 26, 2021 · 7 comments

Comments

@derrickgreenspan
Copy link

derrickgreenspan commented Jun 26, 2021

When attempting to take snapshots on a filesystem with mmapped files, the kernel will oops and future snapshots will never complete. The kernel generates a warning at mm/memory.c:1549 immediately before the oops.

This is the offending code:

if (pte_pfn(*pte) != pfn_t_to_pfn(pfn)) {
     WARN_ON_ONCE(!is_zero_pfn(pte_pfn(*pte)));
     goto out_unlock;         
}

Commenting this code out allows snapshots to proceed without the kernel crashing. I'm not sure whether the resulting snapshot is valid; given that snapshots worked in the past, and earlier kernels did not have this specific code, I suspect that the issue is a regression caused by major changes to the Linux kernel memory management system since NOVA was introduced.

@derrickgreenspan
Copy link
Author

I now believe I understand the consequences of commenting that code out: snapshots will destroy mmap()'d DAX data. Commenting out entry=pte_mkyoung(*pte) and entry=maybe_mkwrite(pte_mkdirty(entry, vma); fixes that.

@Andiry
Copy link
Contributor

Andiry commented Jun 29, 2021

Thanks for the findings. I guess the fix you suggested is not part of NOVA, right? So it is a workround?

@derrickgreenspan
Copy link
Author

derrickgreenspan commented Jun 29, 2021

Thanks for the findings. I guess the fix you suggested is not part of NOVA, right? So it is a workround?

Yes, this fix is a workaround, not part of NOVA code.

I also wanted to ask: the performance of taking snapshots depends on the number of previous snapshots (declining slowly), even if old snapshots are deleted. Is this expected behavior?

@Andiry
Copy link
Contributor

Andiry commented Jun 29, 2021 via email

@derrickgreenspan
Copy link
Author

derrickgreenspan commented Jun 29, 2021 via email

@Andiry
Copy link
Contributor

Andiry commented Jun 29, 2021 via email

@derrickgreenspan
Copy link
Author

derrickgreenspan commented Jun 29, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants