Thanks Jan, It's more and more clear. Just a question, I've a little doubt. Native tasks do not inherit affinity from their parent process. I've read that cpu affinity setting at pthread creation is only availablle in kernel space. Do Posix skin threads inherit affinity from their parent, in user space?
If not, when I "sched_setaffinity" a parent process, I have to recursively "sched_setaffinity" all its threads and force them to switch to primary mode. Is it right ? > >>> 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 > > > This mail has originated outside your organization, either > from an external partner or the Global Internet. > Keep this in mind if you answer this message. > > > This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
