Gilles Carry wrote:
> Before doing any disk I/O, put back thread to SCHED_OTHER/prio 0.
> 

I guess I still don't fully understand why this is an issue.  A 
real-time task will be put to sleep waiting on I/O to complete just like 
any other task.  Perhaps this is just ignorance on my part, while you 
certainly shouldn't expect low latency from an rt thread that is doing 
I/O, I don't see why it shouldn't do I/O at all, even if latency is 
known not to be an issue.  I don't really object to the patch, but I 
would like to understand why it is needed.

--
Darren

> Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
> ---
>  testcases/realtime/func/matrix_mult/matrix_mult.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
> b/testcases/realtime/func/matrix_mult/matrix_mult.c
> index aef626a..0d4eb7a 100644
> --- a/testcases/realtime/func/matrix_mult/matrix_mult.c
> +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
> @@ -279,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);
> @@ -305,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);
> @@ -335,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);
> @@ -408,7 +416,6 @@ int main(int argc, char *argv[])
>               printf("jvmsim disabled\n");
>       }
> 
> -     set_priority(PRIO);
>       main_thread();
> 
>       join_threads();


-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

-------------------------------------------------------------------------
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