From: makarand pradhan <makarand_u_pradhan@domain.hid>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai-core] CPU utilization question
Date: Mon, 24 Oct 2011 15:19:39 -0700 (PDT) [thread overview]
Message-ID: <1319494779.40265.YahooMailNeo@domain.hid> (raw)
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
Greetings all,
I am working on a real time power pc embedded system which uses xenomai. I am presently noticing a CPU utilization which I am not able to explain. Will highly appreciate your opinion on the problem described below.
I'm summarizing my understanding. Pl feel free to correct me.
I'm using /proc/xenomai/stat to get the CPU util. I'm assuming that the ROOT thread captures the %CPU spent in Linux/secnodary and each xenomai thread listed, captures the %CPU in primary domain. If a thread transitions to the secondary, then I'm assuming that the %util in secondary domain will get accounted against ROOT and the actual % usage in primary will get accounted against the thread.
Problem:
I'm starting a xenomai thread using rt_task_spawn.
rt_task_spawn(&task2, "Task 2 ", STACK_SIZE, 11, 0, task2_func, NULL);
The thread invoking rt_task_spawn, sleeps for a long long time without doing anything, or I can pause it.
sleep(5000000);
The xenomai task does rt_printfs periodically.
With this setup, I was hoping to see 0% CPU util for the linux task in top.
Contrary to this expectation, I notice CPU util as high as 3.1% when I top the linux process:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7988 root 20 0 4940 4376 3688 S 3.1 0.8 0:01.65 a.out
The CPU % varies based on the activity I do in the primary domain. i.e. more rt_printfs more %CPU in both primary and secondary.
Question:
If the linux process is sleeping, why do I see a CPU util against the process?
Why is the CPU % util vary based on the activity I do in the primary domain?
Thanks for taking the time to look at the question.
Would highly appreciate your inputs.
Warm Rgds,
Makarand.
[-- Attachment #2: Type: text/html, Size: 5803 bytes --]
next reply other threads:[~2011-10-24 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-24 22:19 makarand pradhan [this message]
2011-10-25 8:50 ` [Xenomai-core] CPU utilization question Gilles Chanteperdrix
2011-10-25 14:18 ` makarand pradhan
2011-10-25 15:16 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1319494779.40265.YahooMailNeo@domain.hid \
--to=makarand_u_pradhan@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.