RAKOTOSALAMA, Nirilanto wrote: >>> Hello, >>> >>> I have some question about CPU affinity with Xenomai 2.3.1. >>> (it is to see if xenomai support developing for a cpu >> manager library is feasible) >> >> What will this library do? (/me just nosy) > > In fact, there's simulation programs that run on many different systems (hard > + soft), > and to make this applications as portable as possible, they use libraries > developed for every > systems (dec alpha, pc, specific cards, linux, unix). And, I search if > xenomai could be used > with less re-implementation effort, so the more posix function are developed > by xenomai, > the better it is, and easier it is (for me :p). > So first step is developing this libraries xenomai support (e.g. timer, cpu). > This cpu library should provides "simple" functions like : getting the number > of cpu, > setting/getting the cpu affinity for a process passing its pid, > protect/un-protect cpu from running > unwanted process.
OK, I see. > >>> When using rt_task_create, CPU mask can be specified. >> However, when sched_setaffinity is called >>> to modify main program affinity, and after, rt_task_create >> is called without specifying CPU mask, >>> did the child task inherits from the main program affinity ? >> If you don't provide a target CPU (either on creation or via >> /proc/xenomai/affinity), better consider the affinity as unspecified >> (any possible CPU). The target CPU derives from Linux >> decision where to >> put the thread non-RT boot code on, Xenomai just nails that decision >> down until someone explicitly migrates. >> >>> Same question for Posix skin threads ? >>> >>> Can native task affinity be set other than when creating ? >> using sdhed_setaffinity ? >> >> /proc/xenomai/affinity (has global scope) or >> sched_setaffinity. Xenomai >> shadow threads follow the migration that may took place while in >> secondary mode, and sched_setaffinity comes with such a mode switch. > > Thanks, If I have well understood, tasks or threads affinity can be set using > /proc/xenomai/affinity > but, I have read that /proc/xenomai/affinity does not exist in xenomai 2.3.1 > and xenomai must be patched Yes, it's an upcoming feature of 2.4. > (I don't know how because I don't have nor SVN neither internet connection on > my xenomai boxes). There is a daily snapshot on gna.org: https://gna.org/svn/?group=xenomai > So I can use sched_setaffinity, but it make switch to secondary mode. > Does'nt matter if only threads must be RT and sched_setaffinity is called > during a non-rt init phase, does it ? Yep. > That means that affinity does'nt depend on running on xenomai or secondary > mode ? Sorry, doesn't parse for me right now. > > BTW, is protecting a CPU with xenomai possible ? > Does xenomai use /dev/cpuset or an other device ? Xenomai doesn't directly interact with cpuset -- but... if you force some RT process into a certain CPU and you don't override this decision on RT thread creation, Xenomai will follow as explained. Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
