path: root/shm.c
AgeCommit message (Collapse)Author
2009-01-08Move shm env parsing to new functionEric B Munson
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2008-11-18Audit verbosity of messages in shm.cAdam Litke
Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2008-10-24privutils: expose the kernel default page sizeAndy Whitcroft
We use the kernel default page size all over the place. We use it approximatly 6 times when setting the boundaries on a single pool. Currently every place looks this value up in /proc/meminfo which is very costly. As this value is essentially static per boot we can cache this value. Create a new routine kernel_default_hugepage_size() which looks this up and caches the result. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Eric B Munson <ebmunson@us.ibm.com> Acked-by: Mel Gorman <mel@csn.ul.ie>
2008-10-14shm: Shared memory always uses the meminfo page sizeAdam Litke
This patch fixes two intertwined issues: When the SHM_HUGETLB flag is passed to shmget(), the system default huge page size is used to back the shared memory segment. Unlike with mmap() there is not yet a way to use an alternate huge page size for shared memory segments. This exception must be taken into account by the shmget override function -- it cannot call gethugepagesize() but must discover the effective huge page size by direct examination of /proc/meminfo. Make the shmoverride test case discover the huge page size in the same manner. The shmoverride_* test case does not always link against libhugetlbfs. Therefore, it cannot use the new mechanism for manipulating pool counters. Unfortunately, this means that the logic to read /proc/meminfo must be duplicated in order for shmoverride_unlinked to build as a NOLIB test. [apw@shadowen.org: consolidate makefile updates in one place] Signed-off-by: Adam Litke <agl@us.ibm.com>
2008-08-14Allow shmget() to be overridden to add the SHM_HUGETLB flagMel Gorman
There are applications that are not hugepage-aware but use shared memory such as the postgres database. It is possible that the SHM_HUGETLB flag could be added to such an application via libhugetlbfs and overriding shmget() to add the SHM_HUGETLB to the flags. This patch enables libhugetlbfs to add the SHM_HUGETLB when a HUGETLB_SHM environment variable is set to "yes". It will work whether the application is linked to libhugetlbfs or loaded via LD_PRELOAD. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Eric Munson <ebmunson@us.ibm.com>