All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: johann.obermayr@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_task_delete trouble
Date: Fri, 11 Mar 2011 14:13:20 +0100	[thread overview]
Message-ID: <4D7A1FF0.6090106@domain.hid> (raw)
In-Reply-To: <4D79F0ED.6080101@domain.hid>

Johann Obermayr wrote:
> We use xenomai 2.5.5.2 and linux kernel 2.6.32.15. gcc 4.3.3
> 
> Here you have some more details.
> a kernel module have a watchdog checker for some 'user-tasks'
> if a 'user-task' have a while loop, than the kernel module will suspend
> the user-task and call also the mayday function.
> 
> But on some other errorhandling, we have a high priortity watchdog task 
> control the 'user'-tasks.
> On error the watchdog task suspend all user-tasks. (this work correct)
> Than the watchdog-task switch off the user-task watchdog.
> Make errorhandling and some other function (dump user-task stack)
> Than the watchdog task will delete some user-task.
> But if a user-task is in a while loop, the system hangs.
> in user mode we have no mayday function.

>From my point of view, you should be using the watchdog provided by
Xenomai. Did you notice that in your application, you can register a
signal handler to handle the watchdog signal? This would allow you to
use the watchdog provided by Xenomai to handle tasks blocked in infinite
loops. Then use your watchdog to handle other cases.

See the example at examples/native/sigdebug.c

> it's look like, that when watchdog-task call rt_task_delete(user_task) , 
> the user_task continue running.
> Is this so ?

Yes, this is probably the reason. The thing is that the watchdog task
calling rt_task_delete calls pthread_cancel, which causes a switch to
secondary mode. What I do not understand, however, is that since you
have priority coupling enabled, it should work. So, I have to reproduce
this case to understand. But actually, now that I think about it,
Wolfgang signalled the same issue with pthread_cancel and the posix skin
a long time ago, I looked at it, and I seem to remember that after
investigation, it could not work.

-- 
					    Gilles.


  parent reply	other threads:[~2011-03-11 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  8:28 [Xenomai-help] rt_task_delete trouble Johann Obermayr
2011-03-11  8:51 ` Gilles Chanteperdrix
2011-03-11  8:58   ` Jan Kiszka
2011-03-11  9:06     ` Gilles Chanteperdrix
2011-03-11  9:59     ` Johann Obermayr
2011-03-11  9:52   ` Johann Obermayr
2011-03-11  9:56     ` Gilles Chanteperdrix
2011-03-11 13:13     ` Gilles Chanteperdrix [this message]
2011-03-11 10:59   ` Johann Obermayr

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=4D7A1FF0.6090106@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=johann.obermayr@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.