From: Subrata <sub...@us...> - 2009-08-23 06:53:45
|
Update of /cvsroot/ltp/ltp/testcases/kernel/power_management/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26444/ltp/testcases/kernel/power_management/lib Modified Files: sched_mc.py Log Message: Patch to fix cpu consolidation failure for kernbench on HT system: Threshold and validation functions modified for testcases run on HT systems. Signed-off-by: poornima nayak <mp...@li...>. Index: sched_mc.py =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/power_management/lib/sched_mc.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sched_mc.py 30 Jun 2009 15:44:48 -0000 1.5 --- sched_mc.py 23 Aug 2009 06:53:37 -0000 1.6 *************** *** 194,197 **** --- 194,199 ---- if stress == "partial": threads = cpu_count / socket_count + if is_hyper_threaded(): + threads = threads / get_hyper_thread_count() if stress == "full": threads = cpu_count *************** *** 245,251 **** try: if stress == "thread": ! threads = 2 if stress == "partial": ! threads = cpu_count / socket_count if stress == "full": threads = cpu_count --- 247,255 ---- try: if stress == "thread": ! threads = 2 if stress == "partial": ! threads = cpu_count / socket_count ! if is_hyper_threaded(): ! threads = threads / get_hyper_thread_count() if stress == "full": threads = cpu_count *************** *** 282,286 **** get_proc_data(stats_start) ! os.system ( '%s/kernbench -o 2 -M -H -n 1 >/dev/null 2>&1' % benchmark_path) print "INFO: Workload kernbench triggerd" --- 286,291 ---- get_proc_data(stats_start) ! os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1' % (benchmark_path, threads)) ! print threads print "INFO: Workload kernbench triggerd" *************** *** 439,442 **** --- 444,449 ---- if core_cpus[i] in modi_cpu_grp: modi_cpu_grp.remove(core_cpus[i]) + if len(modi_cpu_grp) == 0: + return 0 else: # If sched_smt == 0 then its oky if threads run *************** *** 500,504 **** sys.exit(1) ! def validate_cpu_consolidation(sched_mc_level, sched_smt_level): ''' Verify if cpu's on which threads executed belong to same package --- 507,511 ---- sys.exit(1) ! def validate_cpu_consolidation(work_ld, sched_mc_level, sched_smt_level): ''' Verify if cpu's on which threads executed belong to same package *************** *** 507,521 **** try: for l in sorted(stats_percentage.keys()): ! #modify threshold ! if stats_percentage[l][1] > 50: ! cpu_id = stats_percentage[l][0].split("cpu") ! if cpu_id[1] != '': ! cpus_utilized.append(int(cpu_id[1])) ! cpus_utilized.sort() print "INFO: CPU's utilized ", cpus_utilized status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level) ! if status == 1: ! print "INFO: CPUs utilized is not in same package or core" return(status) except Exception, details: --- 514,539 ---- try: for l in sorted(stats_percentage.keys()): ! #modify threshold ! if is_hyper_threaded(): ! if stats_percentage[l][1] > 25 and work_ld == "kernbench": ! cpu_id = stats_percentage[l][0].split("cpu") ! if cpu_id[1] != '': ! cpus_utilized.append(int(cpu_id[1])) ! else: ! if stats_percentage[l][1] > 50: ! cpu_id = stats_percentage[l][0].split("cpu") ! if cpu_id[1] != '': ! cpus_utilized.append(int(cpu_id[1])) ! else: ! if stats_percentage[l][1] > 50: ! cpu_id = stats_percentage[l][0].split("cpu") ! if cpu_id[1] != '': ! cpus_utilized.append(int(cpu_id[1])) ! cpus_utilized.sort() print "INFO: CPU's utilized ", cpus_utilized status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level) ! if status == 1: ! print "INFO: CPUs utilized is not in same package or core" return(status) except Exception, details: |