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

Make use of kvmalloc if available #9034

Closed
wants to merge 4 commits into from

Commits on Nov 12, 2019

  1. Add missing documentation for some KMC flags

    Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    c0d3z3r0 committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    73d7e1f View commit details
    Browse the repository at this point in the history
  2. Make use of kvmalloc if available and fix vmem_alloc implementation

    This patch implements use of kvmalloc for GFP_KERNEL allocations, which
    may increase performance if the allocator is able to allocate physical
    memory, if kvmalloc is available as a public kernel interface (since
    v4.12). Otherwise it will simply fall back to virtual memory (vmalloc).
    
    Also fix vmem_alloc implementation which can lead to slow allocations
    since the first attempt with kmalloc does not make use of the noretry
    flag but tells the linux kernel to retry several times before it fails.
    
    Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    c0d3z3r0 committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    665fc5b View commit details
    Browse the repository at this point in the history
  3. Add kmem_cache flag for forcing kvmalloc

    This adds a new KMC_KVMEM flag was added to enforce use of the
    kvmalloc allocator in kmem_cache_create even for large blocks, which
    may also increase performance in some specific cases (e.g. zstd), too.
    
    Default to KVMEM instead of VMEM in spl_kmem_cache_create.
    
    Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    c0d3z3r0 committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    673755e View commit details
    Browse the repository at this point in the history
  4. check for __GFP_RECLAIM instead of GFP_KERNEL

    check for __GFP_RECLAIM instead of GFP_KERNEL because zfs modfies
    IO and FS flags which breaks the check for GFP_KERNEL.
    
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    c0d3z3r0 committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    a359b5c View commit details
    Browse the repository at this point in the history