All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Jeroen Van den Keybus <jeroen.vandenkeybus@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Scheduling while atomic
Date: Wed, 18 Jan 2006 21:06:35 +0100	[thread overview]
Message-ID: <43CE9FCB.2070305@domain.hid> (raw)
In-Reply-To: <fd6a47a90601171559x13acf2c2m@domain.hid>


[-- Attachment #1.1: Type: text/plain, Size: 1416 bytes --]

Jeroen Van den Keybus wrote:
> Gilles,
> 
> 
> I cannot reproduce those messages after turning nucleus debugging on.
> Instead, I now either get relatively more failing mutexes or even hard
> lockups with the test program I sent to you. If the computer didn't crash,
> dmesg contains 3 Xenomai messages relating to a task being movend to
> secondary domain after exception #14. As when the computer crashes: I have
> written the last kernel panic message on a paper. Please tell if you want
> also the addresses or (part of) the call stack.
> 
> I'm still wondering if there's a programming error in the mutex test
> program. After I sent my previous message, and before I turned nucleus
> debugging on, I managed (by reducing the sleeptimes to max. 5.0e4) to
> fatally crash the computer, while spewing out countless 'scheduling while
> atomic messages'. Is the mutex error reproducible ?

I was not able to crash my box or generate that scheduler warnings, but
the attached patch fixes the false positive warnings of unlocked
mutexes. We had a "leak" in the unlock path when someone was already
waiting. Anyway, *this* issues should not have caused any other problems
then the wrong report of rt_mutex_inquire().

@Gilles: please apply to both trees.

[Update] While writing this mail and letting your test run for a while,
I *did* get a hard lock-up. Hold on, digging deeper...

Jan

[-- Attachment #1.2: mutex-lockcnt.fix --]
[-- Type: text/plain, Size: 931 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 465)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2006-01-18  Jan Kiszka  <jan.kiszka@domain.hid>
+
+	* ksrc/skins/native/mutex.c (rt_mutex_unlock): Fix leaking lockcnt
+	on unlock with pending waiters.
+
 2006-01-16  Gilles Chanteperdrix  <gilles.chanteperdrix@xenomai.org>
 
 	* ksrc/skins/native/task.c (rt_task_create): Use a separate string
Index: ksrc/skins/native/mutex.c
===================================================================
--- ksrc/skins/native/mutex.c	(revision 465)
+++ ksrc/skins/native/mutex.c	(working copy)
@@ -461,8 +461,11 @@
     mutex->owner = thread2rtask(xnsynch_wakeup_one_sleeper(&mutex->synch_base));
 
     if (mutex->owner != NULL)
+	{
+	mutex->lockcnt = 1;
 	xnpod_schedule();
-    
+	}
+
  unlock_and_exit:
 
     xnlock_put_irqrestore(&nklock,s);

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

  parent reply	other threads:[~2006-01-18 20:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17 23:59 [Xenomai-core] Scheduling while atomic Jeroen Van den Keybus
2006-01-18  9:18 ` Gilles Chanteperdrix
2006-01-18 20:06 ` Jan Kiszka [this message]
2006-01-18 20:14   ` Jan Kiszka
2006-01-18 20:25     ` Jan Kiszka
2006-01-29 23:28     ` Philippe Gerum
2006-01-18 20:21   ` Gilles Chanteperdrix
2006-01-18 20:26   ` Gilles Chanteperdrix
2006-01-18 20:30     ` Jan Kiszka
2006-01-18 20:46       ` Jan Kiszka
     [not found]       ` <fd6a47a90601181236u5a482ba5q@domain.hid>
     [not found]         ` <43CEA7AC.9080300@domain.hid>
     [not found]           ` <fd6a47a90601181254s11edbb28l@domain.hid>
     [not found]             ` <43CEADBE.4040802@domain.hid>
2006-01-18 21:11               ` Jeroen Van den Keybus
2006-01-18 21:16                 ` Jan Kiszka
2006-01-18 21:39                   ` Jeroen Van den Keybus
2006-01-18 23:49                     ` Jeroen Van den Keybus
2006-01-18 23:51                       ` Jeroen Van den Keybus
2006-01-19 10:10                         ` Jeroen Van den Keybus
  -- strict thread matches above, loose matches on Subject: below --
2006-01-18 20:04 Jeroen Van den Keybus
2006-01-18 20:20 ` Hannes Mayer
2006-01-18 21:12   ` Jan Kiszka
2006-01-18 21:26     ` Hannes Mayer
     [not found]       ` <fd6a47a90601181334y14b06d6an@domain.hid>
2006-01-18 22:13         ` Hannes Mayer
2006-01-18 22:26           ` Jeroen Van den Keybus
2006-01-18 22:17         ` Jeroen Van den Keybus

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=43CE9FCB.2070305@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=jeroen.vandenkeybus@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.