-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>
- Loading branch information
Josep Puigdemont
committed
Aug 28, 2018
1 parent
6ce60ca
commit 9d832ad
Showing
1 changed file
with
187 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters