PATCH 6/08 numactl - Eliminate page allocation from memtest() measurements Against: numactl-2.0.3-rc2 The first loop [of LOOPS] in memtest() actually incurs the page allocation overhead. This results in an artificially low minimum bandwidth, making the reported bandwidth appear to be more variable than it really is. Make an extra, un-measured pass through test buffer in memtest() to allocate memory. Don't report throughput for page allocation phase. If page allocation overhead is of interest, a separate test could be added. Or, we could make this behavior [measure allocation loop], optional. numademo.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: numactl-2.0.3-rc2/numademo.c =================================================================== --- numactl-2.0.3-rc2.orig/numademo.c 2009-01-30 10:10:15.000000000 -0500 +++ numactl-2.0.3-rc2/numademo.c 2009-02-13 10:05:42.000000000 -0500 @@ -165,7 +165,11 @@ void memtest(char *name, unsigned char * max = 0; min = ~0UL; sum = 0; - for (i = 0; i < LOOPS; i++) { + + /* + * Note: 0th pass allocates the pages, don't measure + */ + for (i = 0; i < LOOPS+1; i++) { clearcache(mem, msize); switch (thistest) { case PTRCHASE: @@ -240,6 +244,9 @@ void memtest(char *name, unsigned char * break; } + if (!i) + continue; /* don't count allocation pass */ + timersub(&end, &start, &res); r = timerfold(&res); if (r > max) max = r; -- To unsubscribe from this list: send the line "unsubscribe linux-numa" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html