Before doing any disk I/O, put back thread to SCHED_OTHER/prio 0.
---
 testcases/realtime/func/matrix_mult/matrix_mult.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
b/testcases/realtime/func/matrix_mult/matrix_mult.c
index 18c3e47..3576427 100644
--- a/testcases/realtime/func/matrix_mult/matrix_mult.c
+++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
@@ -75,10 +75,6 @@ stats_container_t shist, chist;
 static pthread_barrier_t mult_start;
 static pthread_mutex_t mutex_cpu;
 
-int gettid(void)
-{
-       return syscall(__NR_gettid);
-}
 
 void usage(void)
 {
@@ -283,12 +279,16 @@ void main_thread(void)
        /* run matrix mult operation sequentially */
        curdat = &sdat;
        printf("\nRunning sequential operations\n");
+       set_priority(PRIO);
        start = rt_gettime();
        for (i = 0; i < iterations; i++)
                matrix_mult_record(MATRIX_SIZE, i);
        end = rt_gettime();
        delta = (long)((end - start)/NS_PER_US);
 
+       /* Go back to normal prio before doing any disk activity */
+       set_priority_other(0);
+
        savg = delta/iterations; /* don't use the stats record, use the total 
time recorded */
        smin = stats_min(&sdat);
        smax = stats_max(&sdat);
@@ -309,6 +309,7 @@ void main_thread(void)
                fprintf(stderr, "Warning: could not save sequential mults 
stats\n");
        }
 
+       set_priority(PRIO);
        /* Create numcpus-1 concurrent threads */
        for (j = 0; j < (numcpus-1); j++) {
                tids[j] = create_fifo_thread(concurrent_thread, (void 
*)(intptr_t)j, PRIO);
@@ -339,6 +340,9 @@ void main_thread(void)
                pthread_mutex_unlock(&t->mutex);
        }
 
+       /* Go back to normal prio before doing any disk activity */
+       set_priority_other(0);
+
        cavg = delta/iterations; /* don't use the stats record, use the total 
time recorded */
        cmin = stats_min(&cdat);
        cmax = stats_max(&cdat);
@@ -406,7 +410,6 @@ int main(int argc, char *argv[])
                printf("jvmsim disabled\n");
        }
 
-       set_priority(PRIO);
        main_thread();
 
        join_threads();
-- 
1.5.5.GIT


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to