From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>,
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [BUG] trunk: screwed Linux irq state
Date: Mon, 12 Feb 2007 02:10:19 +0100 [thread overview]
Message-ID: <45CFBE7B.3050906@domain.hid> (raw)
In-Reply-To: <45CFB49F.1050000@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 3367 bytes --]
Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Philippe Gerum wrote:
>> > On Mon, 2007-02-12 at 00:07 +0100, Gilles Chanteperdrix wrote:
>> > > Philippe Gerum wrote:
>> > > > On Sun, 2007-02-11 at 23:13 +0100, Jan Kiszka wrote:
>> > > > > Hi,
>> > > > >
>> > > > > while testing 2.6.20 with RTnet, I got this kernel BUG during the slave
>> > > > > startup procedure:
>> > > > >
>> > > > > <4>[ 137.799234] TDMA: calibrated master-to-slave packet delay: 34 us (min/max: 33/38 us)
>> > > > > <4>[ 142.291455] BUG: at kernel/fork.c:993 copy_process()
>> > > > > <4>[ 142.291585] [<c0103a8f>] show_trace_log_lvl+0x1f/0x40
>> > > > > <4>[ 142.291767] [<c0104237>] show_trace+0x17/0x20
>> > > > > <4>[ 142.291896] [<c010432b>] dump_stack+0x1b/0x20
>> > > > > <4>[ 142.292026] [<c0111e94>] copy_process+0x914/0x13d0
>> > > > > <4>[ 142.292190] [<c0112b80>] do_fork+0x70/0x1b0
>> > > > > <4>[ 142.292323] [<c0101078>] sys_clone+0x38/0x40
>> > > > > <4>[ 142.292620] [<c010320f>] syscall_call+0x7/0xb
>> > > > > <4>[ 142.292747] =======================
>> > > > > <3>[ 142.292860] BUG: sleeping function called from invalid context at mm/slab.c:3034
>> > > > > <4>[ 142.293052] in_atomic():0, irqs_disabled():1
>> > > > ^^^^
>> > > >
>> > > > Typical of something going wrong in entry.S.
>> > >
>> > > You mean, interrupts are not really disabled when forking ? :-)
>> > >
>> >
>> > Eh, mmmh, no. Hopefully.
>> >
>> > > So, I am afraid the new fpu_counter optimization is buggy: if a task
>> > > forks with fpu_counter greater than 5 and is preempted right after
>> > > prepare_to_copy in dup_task_struct, when the system switches back to
>> > > this task, the task FPU context will be restored and TS_USEDFPU set in
>> > > the task flags, thereby voiding the effect of prepare_to_copy.
>> > >
>> >
>> > You mean that the parent FPU context would leak into the child's one?
>>
>> Yes, something like that. The result is random segfaults, I do not
>> remember exactly why.
>>
>> > Well, maybe the LKML people would like to know about this. As a
>> > sidenote, I don't see anything bad with your latest counter-measure
>> > disabling this optimization in Xenomai's context switch code, even in
>> > the bugous case above. Right?
>>
>> Right, if there are random segfaults, they will not be xenomai's fault.
>>
>
> I'm currently sorting the symptoms again, or better I'm looking where
> they went to. 2.6.20 just decided to work normally again, 2.6.19 needs a
> re-check.
>
> It appears now that the tracer played an important role, but I'm not
> 100% sure yet. I'll keep you posted.
2.6.19 didn't magically start to work as well. Instead I have a back
trace now, see attachment.
I included a full set of 16k points, but the thrilling things are around
-73 to -25: Some Linux process with IRQs on gets preempted by an RT-IRQ
(RTnet NIC). That triggers an RT kernel thread to run for a while (RTnet
stack manager, prio 98). But when returning to Linux again, its IRQs
remain masked now. The reason must be that weird exception at -62. Don't
know where it comes from and why is there no report about THAT issue in
the kernel logs.
OK, enough for today.
Jan
[-- Attachment #1.2: back-trace.bz2 --]
[-- Type: application/x-bzip, Size: 70700 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next prev parent reply other threads:[~2007-02-12 1:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-11 22:13 [Xenomai-core] [BUG] trunk: screwed Linux irq state Jan Kiszka
2007-02-11 22:26 ` Gilles Chanteperdrix
2007-02-11 22:31 ` Gilles Chanteperdrix
2007-02-11 22:42 ` Philippe Gerum
2007-02-11 23:07 ` Gilles Chanteperdrix
2007-02-11 23:49 ` Philippe Gerum
2007-02-12 0:20 ` Gilles Chanteperdrix
2007-02-12 0:28 ` Jan Kiszka
2007-02-12 1:10 ` Jan Kiszka [this message]
2007-02-12 11:49 ` Jan Kiszka
2007-02-12 13:16 ` Gilles Chanteperdrix
2007-02-12 13:46 ` Philippe Gerum
2007-02-12 13:49 ` Jan Kiszka
2007-02-12 14:10 ` Philippe Gerum
2007-02-12 14:39 ` Gilles Chanteperdrix
2007-02-12 15:10 ` Philippe Gerum
2007-02-12 19:02 ` 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=45CFBE7B.3050906@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=rpm@xenomai.org \
--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.