From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4FBBD830.4010407@xenomai.org> Date: Tue, 22 May 2012 20:17:20 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4FBBBA25.5010308@mind.be> In-Reply-To: <4FBBBA25.5010308@mind.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] CPU occupation without context switches? List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Arnout Vandecappelle Cc: xenomai@xenomai.org On 05/22/2012 06:09 PM, Arnout Vandecappelle wrote: > Hoi, > > After a few minutes of running my application, I see this: > > # cat /proc/xenomai/stat > CPU PID MSW CSW PF STAT %CPU NAME > 1 828 22 65 0 00300182 9.8 bench_RTnet_scope_thread_loop > 1 839 2 46627538 0 00300186 53.8 bench_RTnet > ... > > i.e. the bench_RTnet_scope_thread_loop takes 10% CPU but no > context switches. How is this possible? I've looked at the > source code and can't find an explanation: when the exectime > accounting is updated, the csw is incremented as well (in > __xnpod_schedule()). > > I'm asking because I can't find a reason why this thread should > occupy 10% of the CPU, so I'm wondering if there's something wrong > with the accounting instead. > > BTW this is on Xenomai 2.5.6, on an SMP x86 with affinity=0x01. Could you test Xenomai 2.6.0 to see if you still have the issue? Could you provide us with some minimal code allowing us to reproduce this issue? -- Gilles.