All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] latency kernel part crashes on ppc64
Date: Tue, 10 Jan 2006 10:06:46 +0100	[thread overview]
Message-ID: <43C37926.5060007@domain.hid> (raw)
In-Reply-To: <17346.57955.432284.905332@domain.hid>

Gilles Chanteperdrix wrote:
> Philippe Gerum wrote:
>  > Likely not this time (keep it cold anyway, who knows); I strongly suspect a bug in 
>  > xnarch_switch_to() for all archs but x86
> 
> Now that you are talking about it, I may be the one who owes a beer to
> everyone by first having put a bug in ia64 context-switch code... If I
> am not wrong, the bug should be observed on ia64 too. Unfortunately, I
> am unable to compile my ia64 kernel right now, so I wrote a patch for
> power PC, and would be glad if some power PC owner could try it.
> 

Nope, same lockup with hybrid scheduling.

> It should work on PPC 64 too...
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: include/asm-powerpc/system.h
> ===================================================================
> --- include/asm-powerpc/system.h	(revision 410)
> +++ include/asm-powerpc/system.h	(working copy)
> @@ -182,13 +182,19 @@
>  {
>      struct task_struct *prev = out_tcb->active_task;
>      struct task_struct *next = in_tcb->user_task;
> +    static unsigned long last_ksp;
> +    static xnarchtcb_t *last_tcb;
>  
> +    last_tcb = out_tcb;
>      in_tcb->active_task = next ?: prev;
>  
>      if (next && next != prev) /* Switch to new user-space thread? */
>  	{
>  	struct mm_struct *mm = next->active_mm;
>  
> +        if (prev != out_tcb->user_task)
> +            last_ksp = prev->thread.ksp;
> +
>  	/* Switch the mm context.*/
>  
>  #ifdef CONFIG_PPC64
> @@ -245,6 +251,22 @@
>      else
>          /* Kernel-to-kernel context switch. */
>          rthal_switch_context(out_tcb->kspp,in_tcb->kspp);
> +
> +    /* If we are not the epilogue of a regular linux schedule(),... */
> +    if (likely(test_bit(xnarch_current_cpu(),&rthal_cpu_realtime)) &&
> +        /* we are a user-space thread,... */
> +        out_tcb->user_task &&
> +        /* the last context switch used linux switch routine,... */
> +        last_tcb->active_task != out_tcb->user_task &&
> +        /* but the last xenomai context was a kernel thread,... */
> +        last_tcb->user_task != last_tcb->active_task)
> +        {
> +        /* then linux context switch routine saved kernel thread stack pointer
> +           in last user-space context. We hence put the stack pointers in the
> +           right place. */
> +        last_tcb->ksp = last_tcb->active_task->thread.ksp;
> +        last_tcb->active_task->thread.ksp = last_ksp;
> +        }
>  }
>  
>  static inline void xnarch_finalize_and_switch (xnarchtcb_t *dead_tcb,


-- 

Philippe.


  reply	other threads:[~2006-01-10  9:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08 14:34 [Xenomai-core] latency kernel part crashes on ppc64 Heikki Lindholm
2006-01-08 15:17 ` Jan Kiszka
2006-01-08 16:56   ` Heikki Lindholm
2006-01-08 18:03     ` Jan Kiszka
2006-01-08 18:31       ` Heikki Lindholm
2006-01-08 18:55         ` Jan Kiszka
2006-01-08 18:43       ` Heikki Lindholm
2006-01-08 19:23     ` Gilles Chanteperdrix
2006-01-08 21:02     ` Stelian Pop
2006-01-08 22:06       ` Jan Kiszka
2006-01-09  2:51         ` Philippe Gerum
2006-01-09  8:15           ` Jan Kiszka
2006-01-09  8:38             ` Philippe Gerum
2006-01-09 22:23               ` Gilles Chanteperdrix
2006-01-10  9:06                 ` Philippe Gerum [this message]
2006-01-11 22:11                   ` Gilles Chanteperdrix
2006-01-11 22:35                     ` Jan Kiszka
2006-01-11 23:07                       ` [Xenomai-core] latency kernel part fixed Philippe Gerum
2006-01-12  9:15                         ` Wolfgang Grandegger
2006-01-12 12:52                       ` [Xenomai-core] latency kernel part crashes on ppc64 Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43C37926.5060007@domain.hid \
    --to=rpm@xenomai.org \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.