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

[PATCH v5] linux-gen: ishm: implement huge page cache #685

Closed
wants to merge 2 commits into from

Commits on Sep 10, 2018

  1. linux-gen: ishm: implement huge page cache

    With this patch, ODP will pre-allocate several huge pages at init
    time. When memory is to be mapped into a huge page, one that was
    pre-allocated will be used, if available, this way ODP won't have to
    trap into the kernel to allocate huge pages.
    
    The idea with this implementation is to trick ishm into thinking that
    a file descriptor where to map the memory was provided, this way it
    it won't try to allocate one itself. This file descriptor is one of
    those previously allocated at init time. When the system is done with
    this file descriptor, instead of closing it, it is put back into the
    list of available huge pages, ready to be reused.
    
    A collateral effect of this patch is that memory is not zeroed out
    when it is reused.
    
    WARNING: This patch will not work when using process mode threads.
    For several reasons, this may not work when using ODP_ISHM_SINGLE_VA
    either, so when this flag is set, the list of pre-allocated files is
    not used.
    
    By default ODP will not reserve any huge pages, to tell ODP to do that,
    update the ODP configuration file with something like this:
    shm: {
        num_cached_hp = 32
    }
    
    Example usage:
    
    $ echo odp.config
    odp_implementation = "linux-generic"
    config_file_version = "0.0.1"
    shm: {
        num_cached_hp = 32
    }
    
    $ ODP_CONFIG_FILE=odp.conf ./test/validation/api/shmem/shmem_main
    
    This patch solves bug #3774:
    https://bugs.linaro.org/show_bug.cgi?id=3774
    
    Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>
    Josep Puigdemont committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    1629f09 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2018

  1. linux-gen: ishm: make huge page cache size dynamic

    Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>
    Josep Puigdemont committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    6b0b24a View commit details
    Browse the repository at this point in the history