From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Schermerhorn Subject: [PATCH 6/8] numactl/numademo - eliminate page allocation overhead from memtest measurements Date: Tue, 28 Apr 2009 12:36:56 -0400 Message-ID: <20090428163656.24945.34156.sendpatchset@localhost.localdomain> References: <20090428163621.24945.95516.sendpatchset@localhost.localdomain> Return-path: In-Reply-To: <20090428163621.24945.95516.sendpatchset@localhost.localdomain> Sender: linux-numa-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Cliff Wickman Cc: Kornilios Kourtis , Brice Goglin , linux-numa@vger.kernel.org, eric.whitney@hp.com 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;