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

Fastmap kernel panic #2

Open
robertschade opened this issue Jul 27, 2022 · 2 comments
Open

Fastmap kernel panic #2

robertschade opened this issue Jul 27, 2022 · 2 comments

Comments

@robertschade
Copy link

Hi,
I am trying to use Fastmap in combination with libvmmalloc or vmem to offload memory for quantum chemistry applications to many nvme-drives. I have gotten libvmmalloc and pmem to work. However, Fastmap gives me some trouble by causing kernel panics.
Could you please have a look an give or do you have any idea what the reason could be? Or which additional information would be helpful.

Steps to reproduce:

  • Debian oldstable with Mainline Kernel 4.14.123 running in qemu 7.0.0
  • fastmap commit 1af50c1
  • swap off, transparent huge pages disabled
  • modprobe dmap perma_mmap_buf_size=16
  • /dev/dmap/dmap1 created using scripts/load-it-blkdev.sh
  • rand_threads_read /dev/dmap/dmap1 2
    • seems to work in the sense that is read from the device
  • rand_threads_write /dev/dmap/dmap1 2
    • starts to fill up the dram memory and finally leads to a kernel panic:

image

Things I have tried so far:

  • reducing the size of the cache (perma_mmap_buf_size=16)
@robertschade
Copy link
Author

I have now also tried CentOS 7.2 with Kernel 4.14 but get the same behavior:
image

@JohnMalliotakis
Copy link
Collaborator

Hi, sorry for the late reply! The kernel panic shown in your screenshots appears unrelated to FastMap itself. If you check the function write_bio_async (which appears on the stack trace of your kernel panic) in driver/write_dirty_pages.c, we try to allocate a page directly from the kernel allocator, and use it as both a merge array for pages under writeback, as well as an array for bio structures. Judging from your screenshots, I would say that this allocation request fails and the kernel invokes the OOM reaper.

I would suggest trying to increase the amount of DRAM allocated to the VM on qemu startup. Keep in mind that beyond the memory allocated by FastMap for its page cache, we require some additional memory for the in-memory metadata we maintain, and some additional memory should be reserved for the OS itself. Therefore, if for instance you want to use FastMap with an 8GB page cache, I would suggest setting the VM's available memory to at least 10-12GB. Let me know how that works out for you.

(Also: keep in mind that perma_mmap_buf_size is expressed in terms of 4KB pages, therefore with a value of 16, the FastMap page cache will only be given 64KB of memory)

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