diff options
author | Eric B Munson <emunson@mgebm.net> | 2012-12-01 13:44:00 -0500 |
---|---|---|
committer | Eric B Munson <emunson@mgebm.net> | 2012-12-07 18:13:26 -0500 |
commit | 2a478def078d2606a58b75a3c6b6ec28043c8409 (patch) | |
tree | 751fabb558a03840ca12532e4a9d6576a00a80e2 | |
parent | 8c075e336029bad7d4fafd87cd1e47f75ab50073 (diff) | |
download | libhugetlbfs-2a478def078d2606a58b75a3c6b6ec28043c8409.tar.gz |
Revert "exhaust malloc arenas before malloc tests"
This reverts commit cdd2fa336d9980eb268a775b7cf9c49e3b698cd7.
Conflicts:
tests/hugetests.h
tests/testutils.c
With the removal of sscanf from the setup routines, the malloc tests
now pass without having to exhaust small page allocations.
Signed-off-by: Eric B Munson <emunson@mgebm.net>
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Steve Capper <steve.capper@arm.com>
-rw-r--r-- | tests/hugetests.h | 1 | ||||
-rw-r--r-- | tests/malloc.c | 3 | ||||
-rw-r--r-- | tests/malloc_manysmall.c | 3 | ||||
-rw-r--r-- | tests/testutils.c | 36 |
4 files changed, 0 insertions, 43 deletions
diff --git a/tests/hugetests.h b/tests/hugetests.h index 67af49f..8b1d8d9 100644 --- a/tests/hugetests.h +++ b/tests/hugetests.h @@ -48,7 +48,6 @@ int test_addr_huge(void *p); unsigned long long get_mapping_page_size(void *p); long read_meminfo(const char *tag); ino_t get_addr_inode(void *p); -int consume_heap(long max); int range_is_mapped(unsigned long low, unsigned long high); #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) diff --git a/tests/malloc.c b/tests/malloc.c index dbdd617..a1af5e1 100644 --- a/tests/malloc.c +++ b/tests/malloc.c @@ -61,9 +61,6 @@ int main(int argc, char *argv[]) expect_hugepage = 1; verbose_printf("expect_hugepage=%d\n", expect_hugepage); - if (expect_hugepage) - consume_heap(1024*1024); - for (i = 0; i < NUM_SIZES; i++) { int size = block_sizes[i]; unsigned long long mapping_size; diff --git a/tests/malloc_manysmall.c b/tests/malloc_manysmall.c index 15cf4f0..25086a8 100644 --- a/tests/malloc_manysmall.c +++ b/tests/malloc_manysmall.c @@ -50,9 +50,6 @@ int main(int argc, char *argv[]) if (env) expect_hugepage = 1; - if (expect_hugepage) - consume_heap(1024*1024); - for (i = 0; i < NUM_ALLOCS; i++) { p = malloc(ALLOC_SIZE); if (! p) diff --git a/tests/testutils.c b/tests/testutils.c index 933562f..6298370 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -205,42 +205,6 @@ int range_is_mapped(unsigned long low, unsigned long high) return 0; } -/* malloc memory one byte at a time until: - * - max limit is reached - * - malloc-ed memory is no longer on heap - */ -int consume_heap(long max) -{ - char aname[256]; - int ret; - long consumed = 0; - void *p; - - while (1) { - p = malloc(1); - if (p == NULL) - FAIL("Could not malloc memory"); - - ret = read_maps((unsigned long)p, aname); - if (ret <= 0) - FAIL("read_maps ret <= 0"); - - if (strstr(aname, "heap") == NULL) { - ret = 0; - break; - } - - consumed++; - if (consumed > max) { - verbose_printf("Warning: heap unexpectedly large\n"); - ret = 1; - break; - } - } - verbose_printf("malloc-ed %ld bytes from heap\n", consumed); - return ret; -} - /* * With the inclusion of MAP_HUGETLB it is now possible to have huge pages * without using hugetlbfs, so not all huge page regions will show with the |