From: Jan Kiszka <jan.kiszka@siemens.com>
To: Don Mahurin <don@mperpetuo.com>, xenomai@xenomai.org
Subject: Re: [Xenomai] infinite loop/oops on cat /proc/xenomai/sched/stats when online cpus > present cpus
Date: Tue, 09 Jun 2015 20:24:45 +0200 [thread overview]
Message-ID: <55772F6D.9090509@siemens.com> (raw)
In-Reply-To: <CAJqUr7wNkKZAZzMWz6K4+ydBPiRyoWNZtA713WZLEehhUzNYig@mail.gmail.com>
On 2015-06-05 17:30, Don Mahurin wrote:
> On Thu, Jun 4, 2015 at 5:06 PM, Don Mahurin <don@mperpetuo.com> wrote:
>
>> In the function xnintr_query_next in kernel/cobalt/intr.c,
>>
>> The iterator proceeds to the next entry when the next cpu is nr_cpus.
>> where nr_cpus is set to num_online_cpus().
>>
>> if (cpu + 1 == nr_cpus)
>> iterator->prev = intr;
>> But if there are more cpus present than online, for the case for a timer
>> irq, this condition is never reached, as the following will cause cpu to be
>> reset to 0 if they are at the end of the list.
>>
>> for (cpu = iterator->cpu + 1; cpu < nr_cpus; ++cpu) {
>> if (cpu_online(cpu))
>> break;
>> }
>> if (cpu == nr_cpus)
>> cpu = 0;
>> In our case, we have 8 cpus present, and 4 online.
>>
>> For a timer irq, this will loop 0,1,2,3 repeatedly for the same irq.
>>
>> Can we safely replace 'num_present_cpus' with 'num_online_cpus'?
>>
>> Or do we need another way of detecting the last online cpu for the next
>> entry?
>>
>>
> The attached patch is an alternate fix. This skips past offline cpus when
> detecting last cpu, making no assumptions of the order of online/offline
> cpu's.
Note that Xenomai does not support hotplug for CPUs that are included in
its supported_cpus set. You have to exclude those CPUs by setting
xenomai.supported_cpus during boot accordingly. That should also resolve
the issue you have seen. Can you confirm this?
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2015-06-09 18:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 0:06 [Xenomai] infinite loop/oops on cat /proc/xenomai/sched/stats when online cpus > present cpus Don Mahurin
2015-06-05 15:30 ` Don Mahurin
2015-06-09 18:24 ` Jan Kiszka [this message]
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=55772F6D.9090509@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=don@mperpetuo.com \
--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.