From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4FF44621.5020609@xenomai.org> Date: Wed, 04 Jul 2012 15:33:21 +0200 From: Philippe Gerum MIME-Version: 1.0 References: <4FF369E5.5040007@xenomai.org> <4FF402AD.3020601@xenomai.org> <4FF415AB.2030503@xenomai.org> In-Reply-To: Content-Type: text/plain; charset="iso-8859-1"; format="flowed" Content-Transfer-Encoding: quoted-printable Subject: Re: [Xenomai] Xenomai and normal linux application - Wait time with select() not reliable List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Jens_K=F6hler?= Cc: xenomai@xenomai.org On 07/04/2012 01:45 PM, Jens K=F6hler wrote: > The Xenomai application runs every 2ms for about 150 us and sends/ > receives an udp packet.Rtnet socket is used for udp communication. > > /proc/xenomai/stat: > > CPU PID MSW CSW PF STAT %CPU NAME > 0 0 0 272362 0 00500080 93.8 ROOT > 0 0 0 13475 0 00000082 0.0 rtnet-stack > 0 0 0 1 0 00000082 0.0 rtnet-rtpc > 0 1843 1 11677 0 00300182 0.1 SgbmReceive > 0 1844 1 67501 0 00300184 4.7 SgbmSend > 0 1845 63111 63304 0 00300380 0.3 SgbmUserSpaceComm This thread seems to be switching modes a lot. Does it do this=20 frequently? Each mode switch involves a task switch linux-wise. > 0 1846 1 134963 0 00300184 0.5 SgbmTimer > 0 0 0 67500 0 00000000 0.3 IRQ19: rteth0 > 0 0 0 298425 0 00000000 0.3 IRQ233: [timer] > > Application was ported from RTAI to Xenomai. With Rtai was never a > problem with select. Is it supposed to give us any hint? > > Jens > > > 2012/7/4, Philippe Gerum : >> On 07/04/2012 10:45 AM, Gilles Chanteperdrix wrote: >>> On 07/04/2012 10:36 AM, Jens K=F6hler wrote: >>>> Thank you for your response Gilles. I set thread to SCHED_FIFO policy >>>> with chrt command, Prio 99. But there is no improvement. Also >>>> nanosleep do not help. The kernel is 2.6.26. What could be reason that >>>> kernel is not restart thread when time is over? >>> >>> It could be that the xenomai activity, if any, is running for long >>> periods of time and causing linux ticks to be delayed. As usual, it >>> would help if you could provide a self-contained test-case allowing us >>> to reproduce the issue. >>> >> >> /proc/xenomai/stat as well, in case the rt activity changes mode a lot. >> >> -- >> Philippe. >> >> >> > --=20 Philippe.