All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] infinite loop/oops on cat /proc/xenomai/sched/stats when online cpus > present cpus
@ 2015-06-05  0:06 Don Mahurin
  2015-06-05 15:30 ` Don Mahurin
  0 siblings, 1 reply; 3+ messages in thread
From: Don Mahurin @ 2015-06-05  0:06 UTC (permalink / raw)
  To: xenomai

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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intr-cpus-present-online.patch
Type: application/octet-stream
Size: 770 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20150604/d7259c0c/attachment.obj>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-09 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.