Hi Hitoshi, On 2013/6/7 21:50, Hitoshi Mitake wrote: > At Fri, 7 Jun 2013 09:26:58 +0800, > Jianguo Wu wrote: >> >> Hi Hitoshi, >> >> Thanks for your reply! please see below. >> >> On 2013/6/6 21:54, Hitoshi Mitake wrote: >> >>> Hi Jianguo, >>> >>> On Wed, Jun 5, 2013 at 12:26 PM, Jianguo Wu wrote: >>>> Hi, >>>> One more question, I wrote a memcpy test program, mostly the same as with perf bench memcpy. >>>> But test result isn't consistent with perf bench when THP is off. >>>> >>>> my program perf bench >>>> THP: 3.628368 GB/Sec (with prefault) 3.672879 GB/Sec (with prefault) >>>> NO-THP: 3.612743 GB/Sec (with prefault) 6.190187 GB/Sec (with prefault) >>>> >>>> Below is my code: >>>> src = calloc(1, len); >>>> dst = calloc(1, len); >>>> >>>> if (prefault) >>>> memcpy(dst, src, len); >>>> gettimeofday(&tv_start, NULL); >>>> memcpy(dst, src, len); >>>> gettimeofday(&tv_end, NULL); >>>> >>>> timersub(&tv_end, &tv_start, &tv_diff); >>>> free(src); >>>> free(dst); >>>> >>>> speed = (double)((double)len / timeval2double(&tv_diff)); >>>> print_bps(speed); >>>> >>>> This is weird, is it possible that perf bench do some build optimize? >>>> >>>> Thansk, >>>> Jianguo Wu. >>> >>> perf bench mem memcpy is build with -O6. This is the compile command >>> line (you can get this with make V=1): >>> gcc -o bench/mem-memcpy-x86-64-asm.o -c -fno-omit-frame-pointer -ggdb3 >>> -funwind-tables -Wall -Wextra -std=gnu99 -Werror -O6 .... # ommited >>> >>> Can I see your compile option for your test program and the actual >>> command line executing perf bench mem memcpy? >>> >> >> I just compiled my test program with gcc -o memcpy-test memcpy-test.c. >> I tried to use the same compile option with perf bench mem memcpy, and >> the test result showed no difference. >> >> My execute command line for perf bench mem memcpy: >> #./perf bench mem memcpy -l 1gb -o > > Thanks for your information. I have three more requests for > reproducing the problem: > > 1. the entire source code of your program Please see the attachment. > 2. your gcc version 4.3.4 > 3. your glibc version glibc-2.11.1-0.17.4 Thanks, Jianguo Wu > > I should've requested it first, sorry :( > > Thanks, > Hitoshi > > . >