On Friday 19 October 2007 18:13, Michal Schmidt wrote: > Ankita Garg wrote: > > Hi, > > > > There is a testcase called 'pthread_kill_latency' under the rt-test suite > > on the the RT Wiki: > > > > http://www.kernel.org/pub/linux/kernel/people/dvhart/realtime/tests/rt-te > >st-0.3.tar.bz2 > > > > Description of the testcase: > > > > The test measures the latency involved in sending a signal to a thread > > using pthread_kill. Two threads are created, receiver thread (thread1) > > and sender thread (thread2). Before sending the signal, it waits for > > thread1 to initialize (thread1 waits by calling sigwait), notes the time > > and send pthread_kill signal to thread1. thread1 notes the time it > > receives the signal. The maximum and the minimum latency is reported. > > This is repeated about 10000 times. > > I'm looking at the source. The receiver thread runs with realtime > priority (it's created with create_fifo_thread), but the sender thread > (thread2) doesn't (create_other_thread). The sender does: > > /* Record the time just before sending the signal */ > begin = rt_gettime(); > /**** The sender can get preempted by anything right here ! ****/ > if ((ret = pthread_kill(PTHREADOF(target_thread), SIGNALNUMBER))) { > printf("pthread_kill returned %d\n", ret); > } > > Can this explain it? We have changed the sender to be of priority 1 less than the receiver. This brings down the frequency of seeing high latencies, especially if there is a background load, but does not eliminate them. In fact the logs Ankita posted were with the sender at this RT priority. -Sripathi. > > Michal > > - > To unsubscribe from this list: send the line "unsubscribe linux-rt-users" > in the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html