Hi, Thanks for reviewing this patch!
Ccing Kirill A. Shutemov to get some advice. original mail: http://thread.gmane.org/gmane.linux.ltp/23059 ----- Original Message ----- > On Tue 09-06-15 15:27:17, Cyril Hrubis wrote: > > Hi! > > > > Ccing kernel mm devs. > > > > > Huge Zero Page feature has been added in kernel-3.17, so I draft these > > > testcase to cover it in LTP. > > > > > > hzp01.sh: Checking if the HZP feature works well. > > Does this even work? What would be a difference between thp zero page > and a regular zero pages? Both read faults should use a form of a zero > page AFAICS. I think Kirill's words in the LKML is very good for answering this. :) "During testing I noticed big (up to 2.5 times) memory consumption overhead on some workloads (e.g. ft.A from NPB) if THP is enabled. The main reason for that big difference is lacking zero page in THP case. We have to allocate a real page on read page fault." See: https://lwn.net/Articles/525301/ The case hzp01.sh is base on measure the RSS size of test program memcmp01. In my testingļ¼under 'transparent_hugepage/enabled == always' situation, rss_off is at least larger than 200 times of rss_on. But I just take the compare as "$rss_off > 100*$rss_on", if the HZP works well, the case would be absolutely PASS. Some test data on kernel-4.1.0-rc7: ------ x86_64 ------ # ./hzp01.sh hzp01 1 TINFO : rss_off= 205848 K hzp01 1 TINFO : rss_on= 1052 K hzp01 1 TPASS : Huge Zero Page works well. hzp01 2 TINFO : hzp cleanup. # cat /proc/meminfo |grep -i mem MemTotal: 2005736 kB MemFree: 1637568 kB MemAvailable: 1746236 kB Shmem: 1548 kB ----- ppc64 ----- # ./hzp01.sh hzp01 1 TINFO : rss_off= 1640384 K hzp01 1 TINFO : rss_on= 1984 K hzp01 1 TPASS : Huge Zero Page works well. hzp01 2 TINFO : hzp cleanup. # cat /proc/meminfo |grep -i mem MemTotal: 16690496 kB MemFree: 15569728 kB MemAvailable: 15476544 kB Shmem: 4992 kB > > > > hzp02.sh: Checking if the HZP feature peformed well. > > What does this mean? Just that thp_zero faults are faster? How do you > guarantee reproducibility (e.g. zero_thp disabled performing repeatably) The hzp02.sh dose performance counter stats by 'taskset -c 0 ./memcmp02', with a system HZP on/off, the more memory consumed the more performance better. So I shift the $MEM in hzp02.sh as: -------- +# Configure Memory testing size +if [ $mem_total -gt 16777216 ]; then + MEM=10 + NUM=8 +elif [ $mem_total -gt 8388608 ]; then + MEM=$(( $mem_free / 1024 / 1000 )) + NUM=$(( $MEM - 6 )) +elif [ $mem_total -gt 2097152 ]; then + MEM=2 + NUM=2 +else + tst_brkm TCONF "Sorry, the system RAM is too low to test." +fi -------- Some test data on kernel-4.1.0-rc7: ------ x86_64 ------ # ./hzp02.sh hzp02 1 TINFO : mem_total= 15979404 kB, mem_free= 12273880 kB. hzp02 1 TINFO : time_elapse_off= 112.42 hzp02 1 TINFO : time_elapse_on= 21.70 hzp02 1 TPASS : Huge Zero Page performed well. hzp02 2 TINFO : hzp cleanup. ----- ppx64 ----- # ./hzp02.sh hzp02 1 TINFO : mem_total= 16690496 kB, mem_free= 15549056 kB. hzp02 1 TINFO : time_elapse_off= 326.89 hzp02 1 TINFO : time_elapse_on= 23.68 hzp02 1 TPASS : Huge Zero Page performed well. hzp02 2 TINFO : hzp cleanup. > > > > hzp03.sh: Do Huge Zero Page stress test. > > I fail to see what is this testing actually. Hmm... I'm sorry for unclear here. Maybe modifying the title as: "hzp03.sh: Stress test on HZP sysfs knob" would be better? I also look the hzp03.sh as dispensable. If we all think it's not good, abandon it will be taken into consideration. Regards, Li Wang > > [...] > > > +export TCID="hzp03" > > > +export TST_TOTAL=1 > > > + > > > +. test.sh > > > +. hzp_lib.sh > > > + > > > +MAX_LOOP=2000 > > > +RC=0 > > > + > > > +hzp_stress_test() > > > +{ > > > + for ((i = 0; i < $MAX_LOOP; i++)) > > > + { > > > + hzp_on || RC=$? > > > + hzp_off || RC=$? > > > + } > > > + > > > + if [ $RC -eq 0 ]; then > > > + tst_resm TPASS "finished running the stress test." > > > + else > > > + tst_resm TFAIL "please check log message." > > > + fi > [...] > > > +hzp_on() > > > +{ > > > + echo 1 >$USE_ZERO_PAGE > > > + if [ $? -ne 0 ]; then > > > + tst_brkm TBROK "turn on hzp failed." > > > + fi > > > +} > > > + > > > +hzp_off() > > > +{ > > > + echo 0 >$USE_ZERO_PAGE > > > + if [ $? -ne 0 ]; then > > > + tst_brkm TBROK "turn off hzp failed." > > > + fi > > > +} > -- > Michal Hocko > SUSE Labs > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
