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

kernel bug at mmaped fuse file #1

Closed
krha opened this issue Mar 17, 2013 · 4 comments
Closed

kernel bug at mmaped fuse file #1

krha opened this issue Mar 17, 2013 · 4 comments
Labels

Comments

@krha
Copy link
Contributor

krha commented Mar 17, 2013

This is randomly reported when create overlay VM. It tends to be happen more frequently on low-end machine.

How to reproduce

  • It happends when you access a FUSE file that is mmaped by QEMU process even after QEMU process is terminated.

Follow up Test

  1. QEMU successfully munmap the FUSE file
  2. Make simple program that mmaps FUSE file as QEMU do and munmap successfully. And repeat mmap/munmap several time with FUSE file. This does not cause any problem.

Possible causes

  1. Suspicious on QEMU process, but don't know yet.
  2. Avoid accessing FUSE file access after QEMU finishes.
@krha
Copy link
Contributor Author

krha commented Mar 18, 2013

test

  1. resume VM with pause state
    OK: access memory while KVM is alive
    OK: access memory after KVM finishes (it caused kernel failed in VM running status)
  2. Accessing mmaped memory while running QEMU
    FAILED: kernel panic.
  3. Test with simple dummy program that does mmaped to fuse memory and heavily accesses it.
    OK: no problem.

--> QEMU touches mmaped file in abnormal way?

@krha krha closed this as completed Mar 18, 2013
@krha krha reopened this Mar 18, 2013
@krha
Copy link
Contributor Author

krha commented Mar 18, 2013

It is not happening at Yohsi's code, so the problem might be coming from FUSE related code.
I'll revert my fuse code to original to remove all my modification.

@krha
Copy link
Contributor Author

krha commented Mar 19, 2013

This is interesting bug. It only happens at certain environment where the system has around 4GB memory. It seems to be related to available cache size and cannot reproduce with my custom mmap test program.

Next Test

  1. suspicious on KVM memory management -> disable KVM and test again
    • This case works without problem..means the way KVM touches memory causes this problem. This is why I couldn't reproduce this from my code.
  2. What if I disable EPT? EPT is one difference from my machine and Yoshi's machine.

I disabled EPT by

$ sudo modprobe -r kvm_intel
$ sudo modprobe kvm_intel "ept=0"

and verified disabled EPT by

$ cat /sys/module/kvm_intel/parameters/ept

Wow, it works well without EPT!!

@krha
Copy link
Contributor Author

krha commented Mar 19, 2013

Conclusion

EPT makes problem at mmaped fuse memory.

Workaround

  1. First, check you have EPT support or not.

    $ cat /proc/cpuinfo | grep " ept"
    If it shows something, you have EPT support.

  2. Disable EPT if you have it by

    $ sudo modprobe -r kvm_intel
    $ sudo modprobe kvm_intel "ept=0"

  3. Verify that you successfully disabled it by

    $ cat /sys/module/kvm_intel/parameters/ept
    N
    $

I'll keep working on this. Before having concrete solution, you can use this workaround if you have this problem.

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

No branches or pull requests

1 participant