M. Koehrer wrote: > Hi, > > here are my latest results: > I included xeno_nucleus and xeno_native into the kernel. (see first oprofile > result). > (I also added debug information to the kernel which was of no additional > help). > I detected that most of the time was spent in __ipipe_hard_cpuid. > I looked at that routine and broke that using 2 additional helper functions > that are use > to "monitor" the apic_read() resp. the GET_APIC_ID calls (see patch below). > The results of this experiment can be found at "second oprofile result" below. > When I interpret the results correctly, then it looks as if the apic_read() > is actually > eating up the performance. As this call "leaves" the CPU internal "area" and > accesses the external > APIC this sounds sensible. > I think this is done here to detect the current CPU. > Is it possible to detect differently or to store that information somehow > with a thread (TLS) > to avoid requesting it frequently?
Actually, this is how Linux works. On x86, it used to derive the CPU ID from current_thread_info, which required a valid "current" what Xenomai kernel threads do not guarantee (their stack size is variable, but Linux needs a fixed, predefined one to resolve current). Nowadays (>= 2.6.20) we have PDA (Per-CPU Data Array) on x86, a register based approach, and I think we could safely use it for I-pipe/Xenomai as well. That would make A LOT of thinks easier, because replacing smp_processor_id all over the place to make some code I-pipe aware is a boring job (I recently did so for LTTng...) - and it results in slower code on SMP. As an experiment, you could try implementing the cpuid lookup via raw_smp_processor_id(), given you use 2.6.20. Hmm, maybe/likely some Xenomai tuning is required as well to make sure that the PDA is set correctly when a Xenomai task is created/migrated. Results welcome! Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
