All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-help <xenomai@xenomai.org>, jay@domain.hid
Subject: Re: [Xenomai-help] cannot make system() calls anymore
Date: Sat, 12 Jan 2008 14:20:12 +0100	[thread overview]
Message-ID: <4788BE8C.5020000@domain.hid> (raw)
In-Reply-To: <2ff1a98a0801111029g3d3312ads532b6ec0ca5bcaf7@domain.hid>


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

Gilles Chanteperdrix wrote:
> On Jan 11, 2008 7:22 PM, Jan Kiszka <jan.kiszka@domain.hid> wrote:
>> Jerome Pasquero wrote:
>>> Hi,
>>>
>>> I recently upgraded from xenomai 2.3.0 under linux 2.6.17.14 to the latest
>>> stable version of xenomai 2.4.1 under linux 2.6.23.12.
>>> Everything seems to be working just fine, except that I seem to  no longer
>>> be able to make system calls inside a real-time task. It simply freezes
>>> everything and I need to restart my computer.
>>> I don't know if it was just a fluke that it was working with 2.3.0 and that
>>> I am not supposed to do that at all. Could it be that I forgot to include an
>>> option when recompiling the kernel?
>> A system freeze is not a valid reaction of Xenomai on invalid user
>> activity - unless that freeze just means one of your high-prio tasks
>> decided to enter an endless loop. Have you already tried to enable the
>> Xenomai watchdog?
> 
> A freeze on fork (system calls fork) is typical of the "nocow" stuff
> not working correctly.

Yep, you are most probably right: The page table walks in
ipipe_disable_ondemand_mappings and below is not safe /wrt unused and
bad entries. A test for p?d_none_or_clear_bad is missing, see attached
patch. Jerome, could you try this one and report if it helps? Please
also watch out for kernel messages that might pop up with this patch.

I'm not %100 sure if we should use clear_bad here or better just ignore
bad pages. Once and only once during the last tests, I had a warning
about a bad page in my syslog after running Jerome's test. On the other
hand, most other code in mm/memory.c does it like that. Opinions?

Jerome's test triggered another, less critical I-pipe bug (SMP-related)
I'm going to report separately.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: safe-pagetable-walks.patch --]
[-- Type: text/x-patch; name="safe-pagetable-walks.patch", Size: 1238 bytes --]

---
 mm/memory.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6.24-rc6-xeno_64/mm/memory.c
===================================================================
--- linux-2.6.24-rc6-xeno_64.orig/mm/memory.c
+++ linux-2.6.24-rc6-xeno_64/mm/memory.c
@@ -2827,6 +2827,8 @@ static inline int ipipe_pin_pmd_range(st
 	pmd = pmd_offset(pud, addr);
 	do {
 		next = pmd_addr_end(addr, end);
+		if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
+			continue;
 		if (ipipe_pin_pte_range(mm, pmd, vma, addr, end))
 			return -ENOMEM;
 	} while (pmd++, addr = next, addr != end);
@@ -2843,6 +2845,8 @@ static inline int ipipe_pin_pud_range(st
 	pud = pud_offset(pgd, addr);
 	do {
 		next = pud_addr_end(addr, end);
+		if (pud_none(*pud) || unlikely(pud_bad(*pud)))
+			continue;
 		if (ipipe_pin_pmd_range(mm, pud, vma, addr, end))
 			return -ENOMEM;
 	} while (pud++, addr = next, addr != end);
@@ -2875,6 +2879,8 @@ int ipipe_disable_ondemand_mappings(stru
 		pgd = pgd_offset(mm, addr);
 		do {
 			next = pgd_addr_end(addr, end);
+			if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
+				continue;
 			if (ipipe_pin_pud_range(mm, pgd, vma, addr, next)) {
 				result = -ENOMEM;
 				goto done_mm;

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

  reply	other threads:[~2008-01-12 13:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d3623eab0801110744y63764ba2sb122db96a85bde80@domain.hid>
2008-01-11 16:06 ` [Xenomai-help] cannot make system() calls anymore Jerome Pasquero
2008-01-11 18:22   ` Jan Kiszka
2008-01-11 18:29     ` Gilles Chanteperdrix
2008-01-12 13:20       ` Jan Kiszka [this message]
2008-01-12 16:25         ` Philippe Gerum
2008-01-11 22:33     ` Jerome Pasquero

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=4788BE8C.5020000@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=jay@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.