* [PATCH 1/1] sched: panic, when call schedule with preemption disable
@ 2019-11-21 8:13 YT Chang
2019-11-21 12:30 ` Peter Zijlstra
0 siblings, 1 reply; 3+ messages in thread
From: YT Chang @ 2019-11-21 8:13 UTC (permalink / raw)
To: YT Chang, Peter Zijlstra, Matthias Brugger
Cc: linux-arm-kernel, linux-mediatek, linux-kernel, wsd_upstream
When preemption is disable, call schedule() is incorrect behavior.
Suggest to panic directly rather than depend on panic_on_warn.
Signed-off-by: YT Chang <yt.chang@mediatek.com>
---
kernel/sched/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7880f4f..214e8d8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3861,9 +3861,8 @@ static noinline void __schedule_bug(struct task_struct *prev)
print_ip_sym(preempt_disable_ip);
pr_cont("\n");
}
- if (panic_on_warn)
- panic("scheduling while atomic\n");
+ panic("scheduling while atomic\n");
dump_stack();
add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
}
--
1.9.1
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] sched: panic, when call schedule with preemption disable
2019-11-21 8:13 [PATCH 1/1] sched: panic, when call schedule with preemption disable YT Chang
@ 2019-11-21 12:30 ` Peter Zijlstra
2019-11-26 13:11 ` Kathleen Chang
0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2019-11-21 12:30 UTC (permalink / raw)
To: YT Chang
Cc: Matthias Brugger, linux-mediatek, linux-kernel, wsd_upstream,
linux-arm-kernel
On Thu, Nov 21, 2019 at 04:13:05PM +0800, YT Chang wrote:
> When preemption is disable, call schedule() is incorrect behavior.
> Suggest to panic directly rather than depend on panic_on_warn.
Why!?
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] sched: panic, when call schedule with preemption disable
2019-11-21 12:30 ` Peter Zijlstra
@ 2019-11-26 13:11 ` Kathleen Chang
0 siblings, 0 replies; 3+ messages in thread
From: Kathleen Chang @ 2019-11-26 13:11 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Matthias Brugger, linux-mediatek, linux-kernel, wsd_upstream,
linux-arm-kernel
On Thu, 2019-11-21 at 13:30 +0100, Peter Zijlstra wrote:
> On Thu, Nov 21, 2019 at 04:13:05PM +0800, YT Chang wrote:
> > When preemption is disable, call schedule() is incorrect behavior.
> > Suggest to panic directly rather than depend on panic_on_warn.
>
> Why!?
1. Panic directly will easily find the root cause.
Call scheduling in atomic affects not only performance but also
system stability.
ex:
Call scheduling in IRQ will result in IRQ enable after schedule()
2. A lot of warnings depend on panic_on_warn. It is not practical to
set panic_on_warn=1.
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-26 13:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 8:13 [PATCH 1/1] sched: panic, when call schedule with preemption disable YT Chang
2019-11-21 12:30 ` Peter Zijlstra
2019-11-26 13:11 ` Kathleen Chang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).