On 11/23/18 4:17 PM, Jan Kiszka wrote: > On 23.11.18 16:04, Philippe Gerum wrote: >> On 11/23/18 12:41 PM, Jan Kiszka wrote: >>> On 23.11.18 12:29, Philippe Gerum wrote: >>>> On 11/23/18 12:26 PM, Philippe Gerum via Xenomai wrote: >>>>> On 11/23/18 12:11 PM, Jan Kiszka wrote: >>>>>> On 23.11.18 11:56, Philippe Gerum wrote: >>>>>>> On 11/22/18 6:57 PM, Jan Kiszka via Xenomai wrote: >>>>>>>> This allows to remove the user-triggerable XENO_BUG from >>>>>>>> xnsched_quota_setparam(). >>>>>>> >>>>>>> Could you elaborate on the user trigger point you detected in the >>>>>>> code? >>>>>> >>>>>> pthread_setschedparam_ex(pthread_self(), SCHED_QUOTA, <invalid-tgid>) >>>>> >>>>> Ouch. That is where the bug is rooted, xnthread_set_schedparam() is a >>>>> broken obsolete interface which must be dropped entirely. The right >>>>> way >>>>> to change the scheduling class and/or parameters of a thread is by >>>>> calling xnsched_set_policy(). >>>> >>>> Nope, that won't work either. This needs more thought. >>>> >>> >>> I don't see why catching the invalid tgid down in the sched class this >>> way is a problem, except that we need to enhance the involved callback >>> API a bit. The benefit is that no caller needs to deal with this check >>> and has to become sched-class-aware. >>> >> >> The code says: >> >> /* >> * This is the ONLY place where calling >> * steely_set_schedparam() is legit, sane and safe. >> */ >> effective = steely_set_schedparam(thread, p); > > steely? >
Same on the xenomai side: /* * This is the ONLY place where calling xnsched_setparam() is * legit, sane and safe. */ effective = xnsched_setparam(thread, p); if (effective) { thread->sched_class = sched_class; thread->wprio = xnsched_calc_wprio(sched_class, thread->cprio); } else if (XENO_DEBUG(COBALT)) thread->sched_class = orig_effective_class; -- Philippe.