All of lore.kernel.org
 help / color / mirror / Atom feed
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: BUG: commit "ARM: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW on pre-ARMv6 CPUs" breaks armv5 with CONFIG_PREEMPT
Date: Thu, 20 Jun 2013 12:14:07 +0200	[thread overview]
Message-ID: <51C2D5EF.3040803@pengutronix.de> (raw)
In-Reply-To: <20130620095705.GA18536@arm.com>

On 06/20/2013 11:57 AM, Catalin Marinas wrote:
>>> :040000 040000 034899bdcbc9aa59b5455a85a9d78b646b4cf784 ecc23e33a4ca807d4153f87fbea85a9437ff2928 M      arch
>>
>> The problem can be reproduced on several mx28 and an at91sam9263 and
>> only occurs of CONFIG_PREEMPT (Preemptible Kernel (Low-Latency Desktop))
>> is enabled.
>>
>> I have the gut feeling that the "if (irqs_disabled())" check in the
>> above patch is not correct for CONFIG_PREEMPT.
> 
> The check is there to avoid long interrupt latencies (flushing the whole
> cache with interrupts disabled during context switch). You can drop the
> check and always call cpu_switch_mm() to confirm that it fixes the
> faults.
> 
> finish_task_switch() calls finish_arch_post_lock_switch() after the
> interrupts have been enabled so that the CPU can actually switch the mm.
> I wonder whether we could actually be preempted after
> finish_lock_switch() but before we actually switched the MMU.
> 
> Here's an untested patch (trying to keep it in the arch/arm code):

[...]

When stating userspace I get this reproducible:

init started: BusyBox v1.18.5 (2013-04-04 18:31:36 CEST)
starting pid 50, tty '/dev/console': '/etc/init.d/rcS'
[    7.000828] ------------[ cut here ]------------
[    7.005560] WARNING: at kernel/sched/core.c:2809 finish_task_switch.constprop.84+0xf8/0x164()
[    7.014650] DEBUG_LOCKS_WARN_ON(val > preempt_count())
[    7.019668] Modules linked in:
[    7.023152] CPU: 0 PID: 51 Comm: rcS Not tainted 3.10.0-rc6-00085-gf36ec4f #20
[    7.030923] [<c0013db4>] (unwind_backtrace+0x0/0xf0) from [<c0011b5c>] (show_stack+0x10/0x14)
[    7.039563] [<c0011b5c>] (show_stack+0x10/0x14) from [<c001bed4>] (warn_slowpath_common+0x4c/0x68)
[    7.048732] [<c001bed4>] (warn_slowpath_common+0x4c/0x68) from [<c001bf84>] (warn_slowpath_fmt+0x30/0x40)
[    7.058505] [<c001bf84>] (warn_slowpath_fmt+0x30/0x40) from [<c0047a3c>] (finish_task_switch.constprop.84+0xf8/0x164)
[    7.069303] [<c0047a3c>] (finish_task_switch.constprop.84+0xf8/0x164) from [<c0047d8c>] (schedule_tail+0xc/0x5c)
[    7.079659] [<c0047d8c>] (schedule_tail+0xc/0x5c) from [<c000ee10>] (ret_from_fork+0x4/0x34)
[    7.088240] ---[ end trace 8c7837ef19036347 ]---
mounting filesystems...[    7.222365] BUG: scheduling while atomic: ksoftirqd/0/3/0x00000002
[    7.229222] INFO: lockdep is turned off.
[    7.233361] Modules linked in:
[    7.236502] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: G        W    3.10.0-rc6-00085-gf36ec4f #20
[    7.245509] [<c0013db4>] (unwind_backtrace+0x0/0xf0) from [<c0011b5c>] (show_stack+0x10/0x14)
[    7.254260] [<c0011b5c>] (show_stack+0x10/0x14) from [<c044d908>] (__schedule_bug+0x60/0x78)
[    7.262910] [<c044d908>] (__schedule_bug+0x60/0x78) from [<c0453fec>] (__schedule+0x554/0x624)
[    7.271735] [<c0453fec>] (__schedule+0x554/0x624) from [<c0044cd8>] (smpboot_thread_fn+0x104/0x208)
[    7.280966] [<c0044cd8>] (smpboot_thread_fn+0x104/0x208) from [<c003d5bc>] (kthread+0xa4/0xb0)
[    7.289655] [<c003d5bc>] (kthread+0xa4/0xb0) from [<c000ee20>] (ret_from_fork+0x14/0x34)
[    7.310837] BUG: scheduling while atomic: ksoftirqd/0/3/0x00000002
[    7.317065] INFO: lockdep is turned off.
[    7.321124] Modules linked in:
[    7.324253] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: G        W    3.10.0-rc6-00085-gf36ec4f #20
[    7.333251] [<c0013db4>] (unwind_backtrace+0x0/0xf0) from [<c0011b5c>] (show_stack+0x10/0x14)
[    7.342011] [<c0011b5c>] (show_stack+0x10/0x14) from [<c044d908>] (__schedule_bug+0x60/0x78)
[    7.350539] [<c044d908>] (__schedule_bug+0x60/0x78) from [<c0453fec>] (__schedule+0x554/0x624)
[    7.359342] [<c0453fec>] (__schedule+0x554/0x624) from [<c0044cd8>] (smpboot_thread_fn+0x104/0x208)
[    7.368564] [<c0044cd8>] (smpboot_thread_fn+0x104/0x208) from [<c003d5bc>] (kthread+0xa4/0xb0)
[    7.377364] [<c003d5bc>] (kthread+0xa4/0xb0) from [<c000ee20>] (ret_from_fork+0x14/0x34)
[    7.403225] BUG: scheduling while atomic: ksoftirqd/0/3/0x00000002
[    7.409454] INFO: lockdep is turned off.

..keeps going with "BUG: scheduling while atomic"

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130620/ad1b0c54/attachment.sig>

  parent reply	other threads:[~2013-06-20 10:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  8:43 BUG: commit "ARM: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW on pre-ARMv6 CPUs" breaks armv5 with CONFIG_PREEMPT Marc Kleine-Budde
2013-06-20  9:25 ` Will Deacon
2013-06-20  9:51   ` Marc Kleine-Budde
2013-06-20  9:57 ` Catalin Marinas
2013-06-20 10:08   ` Marc Kleine-Budde
2013-06-20 10:14   ` Marc Kleine-Budde [this message]
2013-06-20 10:28     ` Catalin Marinas
2013-06-20 11:12       ` Catalin Marinas
2013-06-20 11:35         ` Marc Kleine-Budde
2013-06-20 11:39           ` Marc Kleine-Budde
2013-06-20 11:47             ` Marc Kleine-Budde
2013-06-20 12:48               ` Marc Kleine-Budde
2013-06-20 13:01               ` Catalin Marinas
2013-06-20 13:05                 ` Marc Kleine-Budde
2013-06-21 10:28               ` Marc Kleine-Budde
2013-06-21 13:52                 ` Catalin Marinas
2013-07-17  8:41                   ` Marc Kleine-Budde
2013-07-17  8:51                     ` Russell King - ARM Linux
2013-07-17 11:48                       ` Marc Kleine-Budde
2013-07-17 19:41                       ` Catalin Marinas

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=51C2D5EF.3040803@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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.