public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Poornima Nayak <mpnayak@linux.vnet.ibm.com>
To: vaidy <svaidy@linux.vnet.ibm.com>,
	ltp-list@lists.sourceforge.net, gautham <ego@in.ibm.com>,
	arun@linux.vnet.ibm.com
Subject: [LTP] Patch to fix cpu consolidation failure for kernbench on HT system
Date: Thu, 20 Aug 2009 21:38:00 +0530	[thread overview]
Message-ID: <20090820160800.30926.41644.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090820160655.30926.34854.sendpatchset@localhost.localdomain>

Threshold and validation functions modified for testcases run on HT systems. 

Signed-off-by: poornima nayak <mpnayak@linux.vnet.ibm.com>

diff -uprN ltp-full-20090731_orig/testcases/kernel/power_management/lib/sched_mc.py ltp-full-20090731/testcases/kernel/power_management/lib/sched_mc.py
--- ltp-full-20090731_orig/testcases/kernel/power_management/lib/sched_mc.py	2009-08-20 19:59:11.000000000 +0530
+++ ltp-full-20090731/testcases/kernel/power_management/lib/sched_mc.py	2009-08-20 20:33:21.000000000 +0530
@@ -193,6 +193,8 @@ def trigger_ebizzy (stress, duration, ba
             threads = get_hyper_thread_count()
         if stress == "partial":
             threads = cpu_count / socket_count
+            if is_hyper_threaded():
+                threads = threads / get_hyper_thread_count()
         if stress == "full":
 	    threads = cpu_count
 
@@ -244,9 +246,11 @@ def trigger_kernbench (stress, backgroun
     olddir = os.getcwd()
     try:
         if stress == "thread":
-	        threads = 2
+	    threads = 2
         if stress == "partial":
-	        threads = cpu_count / socket_count
+	    threads = cpu_count / socket_count
+            if is_hyper_threaded():
+                threads = threads / get_hyper_thread_count()
         if stress == "full":
             threads = cpu_count
 
@@ -281,7 +285,8 @@ def trigger_kernbench (stress, backgroun
 	    sys.exit(1)
    
         get_proc_data(stats_start)
-        os.system ( '%s/kernbench -o 2 -M -H -n 1 >/dev/null 2>&1' % benchmark_path)
+        os.system ( '%s/kernbench -o %s -M -H -n 1 >/dev/null 2>&1' % (benchmark_path, threads))
+        print threads
         
         print "INFO: Workload kernbench triggerd"
         os.chdir(olddir)
@@ -438,6 +443,8 @@ def validate_cpugrp_map(cpu_group, sched
                         for i in range(0, len(core_cpus)):
                             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
                                 # in different cores of same package 
@@ -499,24 +506,35 @@ def verify_sched_domain_dmesg(sched_mc_l
         print "Reading dmesg failed", details
         sys.exit(1)
 
-def validate_cpu_consolidation(sched_mc_level, sched_smt_level):
+def validate_cpu_consolidation(work_ld, sched_mc_level, sched_smt_level):
     ''' Verify if cpu's on which threads executed belong to same
     package
     '''
     cpus_utilized = list()
     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()
+            #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"
+        if status == 1:
+            print "INFO: CPUs utilized is not in same package or core"
         return(status)
     except Exception, details:
         print "Exception in validate_cpu_consolidation: ", details

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2009-08-20 16:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 16:06 [LTP] Patch to fix kernbench integration issue Poornima Nayak
2009-08-20 16:07 ` [LTP] Patch to fix make install issue in ebizzy Poornima Nayak
2009-08-20 16:52   ` Garrett Cooper
2009-08-23  7:29     ` Subrata Modak
2009-08-20 16:07 ` [LTP] Patch to include workload for consolidation verification Poornima Nayak
2009-08-23  7:29   ` Subrata Modak
2009-08-20 16:07 ` [LTP] Patch to get max sched mc & smt values based on kernel version Poornima Nayak
2009-08-23  7:29   ` Subrata Modak
2009-08-20 16:07 ` [LTP] New & modified reusable functions for new & existing testcases Poornima Nayak
2009-08-20 16:51   ` Garrett Cooper
2009-08-23  7:29     ` Subrata Modak
2009-08-20 16:07 ` [LTP] Patch for PM makefile for new testcases & fix test_sched_smt integration issue Poornima Nayak
2009-08-20 17:01   ` Garrett Cooper
2009-08-23  7:28     ` Subrata Modak
2009-08-20 16:07 ` [LTP] Patch for PM Master script to integrate new testcases Poornima Nayak
2009-08-23  7:29   ` Subrata Modak
2009-08-20 16:08 ` Poornima Nayak [this message]
2009-08-20 17:00   ` [LTP] Patch to fix cpu consolidation failure for kernbench on HT system Garrett Cooper
2009-08-23  7:28   ` Subrata Modak
2009-08-20 16:08 ` [LTP] New testcase to test timer_migration interface Poornima Nayak
2009-08-20 16:57   ` Garrett Cooper
2009-08-20 16:57     ` Garrett Cooper
2009-08-23  7:29     ` Subrata Modak
2009-08-20 16:53 ` [LTP] Patch to fix kernbench integration issue Garrett Cooper
2009-08-23  7:29   ` Subrata Modak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090820160800.30926.41644.sendpatchset@localhost.localdomain \
    --to=mpnayak@linux.vnet.ibm.com \
    --cc=arun@linux.vnet.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=svaidy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox