From: Valentine Barshak <vbarshak@ru.mvista.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Subject: [patch] linux-2.6.14-rt21 PPC32 signal delivery in realtime preemption.
Date: Wed, 30 Nov 2005 17:59:23 +0300 [thread overview]
Message-ID: <438DBE4B.4000709@ru.mvista.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]
Patch description:
With CONFIG_PREEMPT_RT=y and CONFIG_DEBUG_PREEMPT=y
lots of sleeping-in-invalid-context BUG messages are displayed for PPC32
architecture.
Kernel log:
Freeing unused kernel memory: 108k init
BUG: sleeping function called from invalid context init(1) at
kernel/rt.c:1446
in_atomic():1 [00000001], irqs_disabled():0
Call trace:
[c0012010] __might_sleep+0xf0/0xfc
[c0031fd8] __spin_lock+0x38/0x70
[c004ab68] lru_cache_add_active+0x20/0xa0
[c0071c24] install_arg_page+0xf0/0x24c
[c0071ee8] setup_arg_pages+0x168/0x1d4
[c0095674] load_elf_binary+0x44c/0x11d8
[c0072ff4] search_binary_handler+0xfc/0x338
[c00733c0] do_execve+0x190/0x274
[c0005b30] sys_execve+0x80/0xe0
[c0002474] ret_from_syscall+0x0/0x70
[c00050b8] execve+0x8/0x30
[c00016a8] init+0x1b0/0x248
[c0005090] original_kernel_thread+0x48/0x64
This happens because interrupts are not enabled in the realtime preemption
mode by the time kernel delivers signals to processes. This patch enables
interrupts so that realtime mutexes can be acquired in the "right" context.
The original code has been found in CONFIG_PREEMPT_RT support for i386
architecture.
Thanks.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
[-- Attachment #2: ppc_premmpt_rt_signal.patch --]
[-- Type: text/x-patch, Size: 557 bytes --]
diff -rauN linux-2.6.14.orig/arch/ppc/kernel/signal.c linux-2.6.14/arch/ppc/kernel/signal.c
--- linux-2.6.14.orig/arch/ppc/kernel/signal.c 2005-10-28 04:02:08.000000000 +0400
+++ linux-2.6.14/arch/ppc/kernel/signal.c 2005-11-30 17:24:15.268137752 +0300
@@ -705,6 +705,14 @@
unsigned long frame, newsp;
int signr, ret;
+#ifdef CONFIG_PREEMPT_RT
+ /*
+ * Fully-preemptible kernel does not need interrupts disabled:
+ */
+ local_irq_enable();
+ preempt_check_resched();
+#endif
+
if (try_to_freeze()) {
signr = 0;
if (!signal_pending(current))
next reply other threads:[~2005-11-30 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-30 14:59 Valentine Barshak [this message]
2005-11-30 19:54 ` [patch] linux-2.6.14-rt21 PPC32 signal delivery in realtime preemption Ingo Molnar
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=438DBE4B.4000709@ru.mvista.com \
--to=vbarshak@ru.mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox