Skip to contentSkip to conversation

nucleus: Remove xnshadow_relax from taskexit hook

PATCH New Jan Kiszka 3 participants 6 messages Mar 8, 2009 – Mar 10, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 nucleus: Remove xnshadow_relax from taskexit hook

This is no longer needed as do_exit, the caller of this hook, always runs in secondary mode. Enforce this assumptions by leaving a XENO_BUGON behind.

---

 ksrc/nucleus/shadow.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
ksrc/nucleus/shadow.c +2 -3
index e2f2968..66943ba 100644
@@ -2179,12 +2179,11 @@ static inline void do_taskexit_event(struct task_struct *p)
 	if (!thread)
 		return;
 
+	XENO_BUGON(NUCLEUS, xnpod_shadow_p());
+
 	if (xnthread_test_state(thread, XNDEBUG))
 		unlock_timers();
 
-	if (xnpod_shadow_p())
-		xnshadow_relax(0);
-
 	magic = xnthread_get_magic(thread);
 
 	xnlock_get_irqsave(&nklock, s);
author
#1 lore raw

PATCH 1/1 nucleus: Cleanup taskexit hook

[ Enhanced version, removing more unneeded code. ]

xnshadow_relax is no longer needed as do_exit, the caller of this hook, always runs in secondary mode, ie. over the ROOT thread. Enforce this assumptions by leaving a XENO_BUGON behind.

And as the target thread is relaxed already, ie. suspended, there is also no need for a reschedule. Drop the related code.

---

 ksrc/nucleus/shadow.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
ksrc/nucleus/shadow.c +5 -5
index e2f2968..1f90054 100644
@@ -2179,12 +2179,11 @@ static inline void do_taskexit_event(struct task_struct *p)
 	if (!thread)
 		return;
 
+	XENO_BUGON(NUCLEUS, !xnpod_root_p());
+
 	if (xnthread_test_state(thread, XNDEBUG))
 		unlock_timers();
 
-	if (xnpod_shadow_p())
-		xnshadow_relax(0);
-
 	magic = xnthread_get_magic(thread);
 
 	xnlock_get_irqsave(&nklock, s);
@@ -2193,9 +2192,10 @@ static inline void do_taskexit_event(struct task_struct *p)
 	xnthread_archtcb(thread)->user_task = NULL;
 	/* xnpod_delete_thread() -> hook -> xnshadow_unmap(). */
 	xnpod_delete_thread(thread);
-	xnsched_set_resched(thread->sched);
 	xnlock_put_irqrestore(&nklock, s);
-	xnpod_schedule();
+
+	/* The deleted thread was suspended (relaxed), so there is no need for
+	   reschedule. */
 
 	xnshadow_dereference_skin(magic);
 	trace_mark(xn_nucleus, shadow_exit, "thread %p thread_name %s",
author
#2 lore raw

PATCH v2 1/1 nucleus: Cleanup taskexit hook

[ Updated according to discussion. ]

xnshadow_relax is no longer needed as do_exit, the caller of this hook, always runs in secondary mode, ie. over the ROOT thread. Enforce this assumptions by leaving a XENO_BUGON behind.

And as the target thread is relaxed already, ie. suspended, there is also no need for explicit reschedule. But keep xnpod_schedule for the case the exit hook caused a prio change to the ROOT thread.

---

 ksrc/nucleus/shadow.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
ksrc/nucleus/shadow.c +2 -4
index e2f2968..416e675 100644
@@ -2179,12 +2179,11 @@ static inline void do_taskexit_event(struct task_struct *p)
 	if (!thread)
 		return;
 
+	XENO_BUGON(NUCLEUS, !xnpod_root_p());
+
 	if (xnthread_test_state(thread, XNDEBUG))
 		unlock_timers();
 
-	if (xnpod_shadow_p())
-		xnshadow_relax(0);
-
 	magic = xnthread_get_magic(thread);
 
 	xnlock_get_irqsave(&nklock, s);
@@ -2193,7 +2192,6 @@ static inline void do_taskexit_event(struct task_struct *p)
 	xnthread_archtcb(thread)->user_task = NULL;
 	/* xnpod_delete_thread() -> hook -> xnshadow_unmap(). */
 	xnpod_delete_thread(thread);
-	xnsched_set_resched(thread->sched);
 	xnlock_put_irqrestore(&nklock, s);
 	xnpod_schedule();
 
#3 lore raw

[Xenomai-core] Xenosim

Hi
Can anyone tell me what tool chain is required to build a test set-up for the xenosim simulator?
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

#4 lore raw

Re: [Xenomai-core] Xenosim

Quoted 3 lines · Vandana Sasidharan

Hi
Can anyone tell me what tool chain is required to build a test set-up for the xenosim simulator?

1- we already answered this question;
2- your are replying to a mail which is unrelated, for us people which use references-aware mailers, this makes your mail appear in an unexpected place;
3- the fact that you are sending this mail on a public mailing list make the disclaimer your company attached to this mail irrelevant: if you are sending confidential information, then it is stupid to send them to a public mailing list, if not, then the disclaimer is irrelevant, left alone the fact that it is so ridiculously long;
So, since you depise so much the netiquette, I will not answer you. Sorry. Maybe other people will.

Quoted 12 lines

=====-----=====-----=====
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you

Signature · 1 line
                                                 Gilles.
#5 lore raw

Re: [Xenomai-core] Xenosim

Hi Gilles

Thanks a lot and i truly admire your netiquette.
=====-----=====-----=====
Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you