All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] Watchdog / immediate Linux signal delivery
Date: Sun, 08 Mar 2009 11:42:46 +0100	[thread overview]
Message-ID: <49B3A126.6000602@domain.hid> (raw)

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]

Hi,

the watchdog is currently broken in trunk ("zombie [...] would not
die..."). In fact, it should also be broken in older versions, but only
recent thread termination rework made this visible.

When a Xenomai CPU hog is caught by the watchdog, xnpod_delete_thread is
invoked, causing the current thread to be set in zombie state and
scheduled out. But as its Linux mate still exist, hell breaks loose once
Linux tries to get rid of it (the Xenomai zombie is scheduled in again).
In short: calling xnpod_delete_thread(<self>) for a shadow thread is not
working, probably never worked cleanly.

There are basically two approaches to fix it: The first one is to find a
different way to kill (or only suspend?) the current shadow thread when
the watchdog strikes. The second one brought me to another issue: Raise
SIGKILL for the current thread and make sure that it can be processed by
Linux (e.g. via xnpod_suspend_thread(<cpu-hog>). Unfortunately, there is
no way to force a shadow thread into secondary mode to handle pending
Linux signals unless that thread issues a syscall once in a while. And
that raises the question if we shouldn't improve this as well while we
are on it.

Granted, non-broken Xenomai user space threads always issue frequent
syscalls, otherwise the system would starve (and the watchdog would come
around). On the other hand, delaying signals till syscall prologues is
different from plain Linux behaviour...

Comments, ideas?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

             reply	other threads:[~2009-03-08 10:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-08 10:42 Jan Kiszka [this message]
2009-03-08 13:41 ` [Xenomai-core] Watchdog / immediate Linux signal delivery Gilles Chanteperdrix
2009-03-08 14:23   ` Jan Kiszka
2009-03-08 14:43     ` Gilles Chanteperdrix
2009-03-08 14:55       ` Jan Kiszka
2009-03-09 15:50 ` Philippe Gerum
2009-03-09 16:44   ` Jan Kiszka
2009-03-09 17:02     ` Gilles Chanteperdrix
2009-03-09 17:15       ` Jan Kiszka
2009-03-09 17:27       ` Philippe Gerum
2009-03-09 17:09     ` Philippe Gerum
2009-03-09 17:12       ` Jan Kiszka
2009-03-09 17:37         ` Philippe Gerum
2009-03-09 23:49           ` Jan Kiszka
2009-03-10  9:20             ` Philippe Gerum
2009-03-09 17:27       ` Jan Kiszka
2009-03-09 17:38         ` Philippe Gerum
2009-03-09 17:58           ` Gilles Chanteperdrix
2009-03-10 11:09             ` Jan Kiszka
2009-03-10 13:17               ` Gilles Chanteperdrix
2009-03-09 23:46           ` Jan Kiszka

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=49B3A126.6000602@domain.hid \
    --to=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.