aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-12-16Make hugetlbfs_prefault always use /dev/zero as a readv sourceEric B Munson
On some implementations of readv passing in the fd used to map a region as a source fd causes readv to fail with the error Invalid Argument. Instead of having hugetlbfs_prefault take an fd argument it now opens /dev/zero as the source. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-30Move global boolean values to use bool typeEric B Munson
This patch moves the global boolean values __hugetlbfs_debug and __hugetlbfs_prefault to the bool type. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-30Move boolean entries in hugetlbfs_opts to type boolEric B Munson
This patch transitions all the boolean entries in the hugetlbfs_opts struct to use the bool type and all assignments to these entries to use true and false as appropriate. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-29Convert heap tests to use get_mapping_page_sizeEric B Munson
Convert all the heap based tests to use get_mapping_page_size to check if a mapping is backed by huge pages now that morecore uses MAP_HUGETLB. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-29Use MAP_HUGETLB for heap mappingsEric B Munson
As with get_huge_pages it is appropriate to use MAP_HUGETLB for mappings that will hold the heap. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Convert the get_huge_pages tests to use new smaps testEric B Munson
If get_huge_pages uses MAP_HUGETLB to create a new huge page region, the old test_addr_huge function will claim the mapping is not on a huge page. This patch changes the test to use the new get_mapping_page_size method. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-29Use MAP_HUGETLB in get_huge_pagesEric B Munson
When the kernel supports MAP_HUGETLB use it for requesting a huge page backed area instead of creating a file descriptor. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Read /proc/self/smaps to test page size of mappingEric B Munson
When MAP_HUGETLB is used, the standard test for a mapping being backed by huge pages fails because the mapping will not be on hugetlbfs. Instead of testing the filesystem backing the mapping, this patch adds a check of reported MMU page size from /proc/self/smaps. get_mapping_page_size returns the page size that is being used for the specified mapping in bytes. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Transition hugetlbfs_prefault to handle MAP_HUGETLBEric B Munson
hugetlbfs_prefault relies on having a file descriptor associated with the huge page backed region to prefault the huge pages. This patch gives an alternative for prefaulting which will be used when the kernel supports MAP_HUGETLB. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Separate finding page sizes from mount pointsEric B Munson
Now that we have the ability to map huge pages without having an active hugetlfs mount point with MAP_HUGETLB it no longer makes sense to detect valid page sizes based on active mount points. This patch separates out the detection of valid page sizes from the detection of active mount points. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Add check for MAP_HUGETLB supportEric B Munson
This patch adds a check for MAP_HUGETLB support and a flag in __hugetlb_opts for holding the availability. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-29Add kernel feature check for MAP_HUGETLBEric B Munson
Since 2.6.32 the kernel has supported pseudo-anonymous mmaps for huge pages without having hugetlbfs mounted. This patch adds a check for that kernel feature. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
2010-11-17Rename variable in inline functionEric B Munson
hpage_size is a fairly common variable name in this library so it is dangerous to use it in an inlined function. This patch renames it to __hpage_size to avoid name collisions. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-17Fix typo in pagesize help outputEric B Munson
Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-15find_mounts(): ignore non-hugetlbfs filesystemsAndrew Hastings
libhugetlbfs attempts to restrict its statfs calls to only hugetlbfs filesystems. Unfortunately, the sscanf pattern isn't quite correct, and libhugetlbfs ends up calling statfs on all mounted filesystems. This can be quite costly when many network filesystems are mounted. Correct the sscanf pattern. Signed-off-by: Andrew Hastings <abh@cray.com> on behalf of Cray Inc. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-15Add timeout to find_or_prepare_shared_fileEric B Munson
find_or_prepare_shared_file has a message stating that it should have a timeout so that we don't spin forever waiting on a shared file. In practice this would be very unlikely but this patch adds a timeout check to protect from spinning. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-11Remove redundant hpage_size check from hugetlbfs_setup_morecoreEric B Munson
In hugetlbfs_setup_morecore there is a second check of hpage_size <= 0 but if we get to it we already know that hpage_size will be > 0. This patch removes the second check. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-11-09Fix return value tests for hugetlbfs_test_featureEric B Munson
The function hugetlbfs_test_feature currently returns 0 if the requested feature is not present, a positive integer if the feature is present, and -ENOSYS if the requested feature is invalid. The way that hugetlbfs_test_feature is currently used is any non-zero return value means the requested feature is present. This patch corrects this usage to use only positive integer return values to mean a feature is present. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: don't crash when empty group name is provided.Anton Arapov
Don't crash with the empty group name provided, rather suggest "hugepages" one and use it by the default. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: fix the crash where the user and group were the same.Anton Arapov
Huge page setup script was unable to create hugepages user with the same group. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: make r/w ops of security/limits.d/*.conf more robust.Anton Arapov
previous routine led to failures on \n, whitespace, comment in configuration file. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: check for permission and disable default debug modeAnton Arapov
1. fallback gracefully with explanation; 2. do actual work; not just print out; // *debug*mode* off. Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: fix the minor arithmetic issue.Anton Arapov
we do want compare MiB with MiB. Reported-by: CAI Qian <caiqian@redhat.com> Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-20setup_helper: whitespace fixesAnton Arapov
ssia. important thing in python... Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11tlbmiss_cost.sh: Suppress errors from opreportMel Gorman
If opreport throws up an error, it shows up in the tlbmiss_cost.sh output. Stop that. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11tlbmiss_cost.sh: Allow monitoring of TLB miss events on a global basisMel Gorman
The structure of the script is to measure TLB misses of a specific PID or a target application. There are cases when we want to monitor globally because there are a large number of interacting applications and we want a big picture view. This patch implements a --target-global switch to report on global events. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11tlbmiss_cost.sh: Cache the value for tlb miss costMel Gorman
It takes quite a long time to calculate the value of a TLB miss cost. Once calculated, this patch caches the value in one of two places. If it has the necessary permission, it's recorded in /etc/tlbmisscost.conf/etc/tlbmisscost.conf. It is also recorded in $HOME/.tlbmisscostrc. Cached values are reused later unless -f or --ignore-cache is specified. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11cpupcstat: Reduce the sampling rate used by oprofileMel Gorman
oprofile at its maximum sampling rate causes a lot of interference. There is no good automatic way of finding out a non-interfering level as it basically depends on the workload. Still, we can reduce the impact somewhat with this patch. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11cpupcstat: Report time spent servicing TLB missesMel Gorman
While cpupcstat appeared to have most of the infrastructure necessary to work out the time spent servicing TLB misses, it does not make the actual calculation and print it. This patch should cover it. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11cpupcstat: Document the --time-servicing switchMel Gorman
Add usage and manual page information on --time-servicing. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11cpupcstat: Print a more appropriate header for TLB miss time percentageMel Gorman
The current header is misleading. Fix it. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11cpupcstat: Ignore private caching of tlb cost informationMel Gorman
tlbmiss_cost.sh now knows how to cache TLB miss cost information. Do not duplicate the work in cpupcstat. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-11oprofile_map_events.pl: Add an instructions retired event for i386/coreMel Gorman
Add an instructions retired event for i386/core. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-10-08Update NEWS file for 2.10 release2.10Eric B Munson
Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-09-24Fix pool adjust when using negative deltaEric B Munson
hugeadm has always accepted deltas for adjusting huge page pool sizes, but when support was added for 16G page sizes an unsigned value was used. This causes problems when a negative delta is used, instead of shrinking the pool, the pool size is set to a very large number, usually crippling the machine as the kernel attempts to use all of the memory as huge pages. This patch changes the value to a signed long long which is still large enough to hold a 16G page size. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-09-24Change PREFIX and EXEDIR to be set with ?=Eric B Munson
This patch alters the Makefile to use ?= to set the EXEDIR and the PREFIX which will allow easier modification of these values during scripted builds. Signed-off-by: Eric B Munson <emunson@mgebm.net>
2010-06-28Update NEWS for 2.9 release2.9Eric B Munson
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-06-02Add switch to follow NUMA memory policy when availableEric B Munson
This patch adds the --obey-numa-mempol which requests that the machine allocate hugepages based on the NUMA memory policy if it is available. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-06-01Fix bug in gethugepagesizes testcaseDavid Gibson
The gethugepagesizes testcase tests the calls to retreieve the available page sizes against faked up sysfs contents. This includes testing that the gethugepagesizes() call doesn't return more entries than the maximum it's given (which might clobber memory). However, it does this incorrectly: specifically, validate_sizes() checks that the n returned entries exactly match the first n expected entries, even when the maxmum number of entries to return is smaller than the total number of pagesizes available. gethugepagesizes() is not guaranteed to return the pagesizes in any particular order (based as it is on getting a directory listing), so this test will generate bogus failures. In fact, for the case where the given maximum is smaller than the total number of pagesizes, the test should accept as a pass any subset of the expected pagesizes in the returned results. This patch makes the correction. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-05-17Allow MAP_NORESERVE to be used on an earlier kernelMel Gorman
The patch that allows MAP_NORESERVE to be safely used was unexpectedly merged for 2.6.34 instead of 2.6.35. Update the kernel features test accordingly. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-05-13Add POWER6 events for TLB miss cost calculatorEric B Munson
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-05-13Allow MAP_NORESERVE to be used for mappingsMel Gorman
Since 2.6.27-rc1, the kernel makes reservations for mappings at mmap() time. This guarantees that the process that successfully calls mmap() will successfully fault all pages within that region. This is nice reliable behaviour but it can be the case the program wants to create a very large sparse mapping. In this case, mmap() will fail even if the program knows the huge pages are available. This patch introduces a --no-reserve switch that uses MAP_NORESERVE. mmap() will always succeed but the fault might not. Unfortunately, on older kernels, use of MAP_NORESERVE can trigger the OOM killer. Hence, this patch also checks the kernel version and only allows use of MAP_NORESERVE if it's safe to do so. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Eric B Munson <ebmunson@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-30NEWS update for 2.8 release2.8Eric B Munson
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-30Disable executable stacks for library and helpers V4Eric B Munson
Currently the library and all the helpers are built with their stack mappings markes executable. This could be a security issue and shouldn't be allowed unless necessary. This patch disables executable stacks for the library and the helper programs. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-30add --vmlinux option to tlbmiss_cost.shAvantika Mathur
tlbmiss_cost.sh does not currently take vmlinux as a parameter, and calls oprofile_start.sh, which uses the location of vmlinux. This patch adds an optional --vmlinux option to the script, and passes this value to calls of oprofile_start.sh. It also changes the call to the tlbmiss_cost.sh from cpupcstat to pass the vmlinux value used in cpupcstat. Signed-off-by: Avantika Mathur <mathur@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-27cpupcstat - cache tlbmiss-cost valueAvantika Mathur
Currently, cpupcstat runs tlbmiss_cost.sh every run to get the tlbmiss cost used to calculate % time spent servicing tlb misses. This patch changes cpupcstat to cache the tlbmiss cost in a local file, tlbmisscost. If the cache file exists, it uses the cached value. If the file does not exist, it runs tlbmiss_cost.sh to generate cost, uses this value and caches the result for later runs. If the user specifies a file using the --cost-config, uses the tlbmiss cost stored in this file. Signed-off-by: Avantika Mathur <mathur@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-27OpCollect.pm - fix parameters in _get_column() callAvantika Mathur
Fix parameters being passed to _get_column(). $report is no longer passed because it is global. Signed-off-by: Avantika Mathur <mathur@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-25Protect against div by 0 errorEric B Munson
Currently if no dtlb misses are observed in a time period and either --misses-per-instruction or --misses-per-cycle are specified, the script will hit a division by zero error. This patch protects the division against this error. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-24Add read_eventcount to collectors and cpupcstatEric B Munson
This patch seperates the data collection from the data processiong to allow better processing of multiple events. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
2010-03-24Add read_eventcount method to base data collection classEric B Munson
Add the method for reading event counts from the data collection method. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>