Module: xenomai-forge
Branch: master
Commit: 8650192fbf7ebbfba793722eeefa800cc9ea9415
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8650192fbf7ebbfba793722eeefa800cc9ea9415

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Dec 12 18:29:06 2011 +0100

cobalt/nucleus: do not propagate thread priority changes from Linux to Xenomai

Propagating priority updates caused by the regular
pthread_setschedparam() to the Xenomai domain never made much sense,
and clearly does not make any sense over Cobalt.

Applications using the Cobalt interface should use the wrapped call to
change the priority of a thread within the Xenomai
scheduler. Copperplate-based applications should use the relevant call
provided by their API of choice, which in turn shall invoke Cobalt's
wrapped call to change this priority.

In short, we now require for Xenomai what the glibc started requiring
with the introduction of cached priority levels: changing a thread
priority must be done through our dedicated service, or this won't
work.

---

 include/asm-generic/hal.h      |    2 -
 kernel/cobalt/nucleus/shadow.c |   42 ----------------------------------------
 2 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index 7b35817..04acab2 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -301,8 +301,6 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
     ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_SIGWAKE,hdlr)
 #define rthal_catch_schedule(hdlr)     \
     ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_SCHEDULE,hdlr)
-#define rthal_catch_setsched(hdlr)     \
-    ipipe_catch_event(&rthal_domain,IPIPE_EVENT_SETSCHED,hdlr)
 #define rthal_catch_losyscall(hdlr)    \
     ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_SYSCALL,hdlr)
 #define rthal_catch_hisyscall(hdlr)    \
diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c
index 2993bd1..ab4ed2d 100644
--- a/kernel/cobalt/nucleus/shadow.c
+++ b/kernel/cobalt/nucleus/shadow.c
@@ -2379,46 +2379,6 @@ static inline void do_sigwake_event(struct task_struct 
*p)
 
 RTHAL_DECLARE_SIGWAKE_EVENT(sigwake_event);
 
-static inline void do_setsched_event(struct task_struct *p, int priority)
-{
-       xnthread_t *thread = xnshadow_thread(p);
-       union xnsched_policy_param param;
-       struct xnsched *sched;
-
-       if (!thread || (p->policy != SCHED_FIFO && p->policy != SCHED_NORMAL))
-               return;
-
-       if (p->policy == SCHED_NORMAL)
-               priority = 0;
-
-       /*
-        * Reflect a Linux priority change for a given thread in the
-        * Xenomai scheduler.
-        *
-        * Linux's priority scale is a subset of the core pod's
-        * priority scale, so there is no need to bound the priority
-        * values when mapping them from Linux -> Xenomai.
-        *
-        * BIG FAT WARNING: Change of scheduling parameters from the
-        * Linux side are propagated only to threads that belong to
-        * the Xenomai RT scheduling class. Threads from other classes
-        * remain unaffected, since we could not map this information
-        * 1:1 between Linux and Xenomai.
-        */
-       if (thread->base_class != &xnsched_class_rt ||
-           thread->cprio == priority)
-               return;
-
-       param.rt.prio = priority;
-       __xnpod_set_thread_schedparam(thread, &xnsched_class_rt, &param, 0);
-       sched = xnpod_current_sched();
-
-       if (xnsched_resched_p(sched))
-               xnpod_schedule();
-}
-
-RTHAL_DECLARE_SETSCHED_EVENT(setsched_event);
-
 static inline void do_cleanup_event(struct mm_struct *mm)
 {
        struct task_struct *p = current;
@@ -2561,7 +2521,6 @@ void xnshadow_grab_events(void)
        rthal_catch_taskexit(&taskexit_event);
        rthal_catch_sigwake(&sigwake_event);
        rthal_catch_schedule(&schedule_event);
-       rthal_catch_setsched(&setsched_event);
        rthal_catch_cleanup(&cleanup_event);
        rthal_catch_return(&mayday_event);
 }
@@ -2571,7 +2530,6 @@ void xnshadow_release_events(void)
        rthal_catch_taskexit(NULL);
        rthal_catch_sigwake(NULL);
        rthal_catch_schedule(NULL);
-       rthal_catch_setsched(NULL);
        rthal_catch_cleanup(NULL);
        rthal_catch_return(NULL);
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to