Find the answer to your Linux question:
Results 1 to 5 of 5
Hi I am using memory mapped files in java which is just a wrapper for the Linux kernel mmap feature, however performance is bad under heavy writes due to the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    6

    Angry /proc/sys/vm/flush_mmap_pages missing in 3.9 kernel, how to get it?


    Hi

    I am using memory mapped files in java which is just a wrapper for the Linux kernel mmap feature, however performance is bad under heavy writes due to the kernel writing dirtypages to disk all the time (my SSD chokes). Instead I want to manually write the pages to disk using MappedByteBuffer.force() when I choose. However for this to work I have to disable automatic flushing by the kernel.

    There was an option in redHat 5.2 called flush_mmap_pages, I could set this to zero and that would turn of writing dirty pages from mappedmemory. However it is missing in newer kernels, I am using fedora 17 on linux 3.9 kernel ATM and it is not there. Is there anyway to apply a kernel patch to get it back, does anybody know the last kernel version to support this kernel parameter?

    Thanks in Advance

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    clearly it has been removed by the kernel devs, probably for good reasons. if you really want it on your current distro, you could always grab the kernel from kernel.org that is the same version as that from RHEL 5.2 (2.6.18 or so) and compile that for your system.

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    6
    thought I might have to do that, oh well guess i'll be stuck on 2.6 forever now.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    that's interesting that they'd get rid of a feature that clearly you are able to demonstrate is still needed. have you tried mounting RAM to a tmpfs filesystem that you app can use?

    e.g.:
    Code:
    mount -t tmpfs tmpfs /ramdisk
    then use /ramdisk like you'd normally use any other directory - only it's balls faster.

  5. #5
    Just Joined!
    Join Date
    Sep 2006
    Posts
    6
    yea I could use a tmpfs but it would not be as efficicent, because I would have to only use it as a write cache, and still have a mappedmemoryFile for a read cache meaning I would have duplicate portions of the file in memory.

    The file I am read/writing is in TB so It will not fit in ram. Atm I am tuning other linux VM paging features such as dirty_background_bytes, dirty_expire_centisecs and dirty_ratio however these affect all of paged memory not just paged memory from mapped files so it gets a bit tricky.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •