From: Marek Szyprowski <m.szyprowski@samsung.com>
To: John Stultz <jstultz@google.com>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org,
Linux Samsung SOC <linux-samsung-soc@vger.kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [tip: sched/urgent] sched/deadline: Fix dl_server getting stuck
Date: Tue, 23 Sep 2025 08:31:26 +0200 [thread overview]
Message-ID: <47563570-7339-43da-af15-4acf7b93075c@samsung.com> (raw)
In-Reply-To: <CANDhNCrztM1eK-6dab_-4hnX4miJH_pe49r=GVVqtD+Z235kgw@mail.gmail.com>
On 23.09.2025 01:46, John Stultz wrote:
> On Mon, Sep 22, 2025 at 2:57 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> This patch landed in today's linux-next as commit 077e1e2e0015
>> ("sched/deadline: Fix dl_server getting stuck"). In my tests I found
>> that it breaks CPU hotplug on some of my systems. On 64bit
>> Exynos5433-based TM2e board I've captured the following lock dep warning
>> (which unfortunately doesn't look like really related to CPU hotplug):
>>
> Huh. Nor does it really look related to the dl_server change. Interesting...
>
>
>> # for i in /sys/devices/system/cpu/cpu[1-9]; do echo 0 >$i/online; done
>> Detected VIPT I-cache on CPU7
>> CPU7: Booted secondary processor 0x0000000101 [0x410fd031]
>> ------------[ cut here ]------------
>> WARNING: CPU: 7 PID: 0 at kernel/rcu/tree.c:4329
>> rcutree_report_cpu_starting+0x1e8/0x348
>> Modules linked in: brcmfmac_wcc cpufreq_powersave cpufreq_conservative
>> brcmfmac brcmutil sha256 snd_soc_wm5110 cfg80211 snd_soc_wm_adsp cs_dsp
>> snd_soc_tm2_wm5110 snd_soc_arizona arizona_micsupp phy_exynos5_usbdrd
>> s5p_mfc typec arizona_ldo1 hci_uart btqca s5p_jpeg max77693_haptic btbcm
>> s3fwrn5_i2c exynos_gsc bluetooth s3fwrn5 nci v4l2_mem2mem nfc
>> snd_soc_i2s snd_soc_idma snd_soc_hdmi_codec snd_soc_max98504
>> snd_soc_s3c_dma videobuf2_dma_contig videobuf2_memops ecdh_generic
>> snd_soc_core ir_spi videobuf2_v4l2 ecc snd_compress ntc_thermistor
>> panfrost videodev snd_pcm_dmaengine snd_pcm rfkill drm_shmem_helper
>> panel_samsung_s6e3ha2 videobuf2_common backlight pwrseq_core gpu_sched
>> mc snd_timer snd soundcore ipv6
>> CPU: 7 UID: 0 PID: 0 Comm: swapper/7 Not tainted 6.17.0-rc6+ #16012 PREEMPT
>> Hardware name: Samsung TM2E board (DT)
>> Hardware name: Samsung TM2E board (DT)
>> Detected VIPT I-cache on CPU7
>>
>> ======================================================
>> WARNING: possible circular locking dependency detected
>> 6.17.0-rc6+ #16012 Not tainted
>> ------------------------------------------------------
>> swapper/7/0 is trying to acquire lock:
>> ffff000024021cc8 (&irq_desc_lock_class){-.-.}-{2:2}, at:
>> __irq_get_desc_lock+0x5c/0x9c
>>
>> but task is already holding lock:
>> ffff800083e479c0 (&port_lock_key){-.-.}-{3:3}, at:
>> s3c24xx_serial_console_write+0x80/0x268
>>
>> which lock already depends on the new lock.
>>
>>
>> the existing dependency chain (in reverse order) is:
>>
>> -> #2 (&port_lock_key){-.-.}-{3:3}:
>> _raw_spin_lock_irqsave+0x60/0x88
>> s3c24xx_serial_console_write+0x80/0x268
>> console_flush_all+0x304/0x49c
>> console_unlock+0x70/0x110
>> vprintk_emit+0x254/0x39c
>> vprintk_default+0x38/0x44
>> vprintk+0x28/0x34
>> _printk+0x5c/0x84
>> register_console+0x3ac/0x4f8
>> serial_core_register_port+0x6c4/0x7a4
>> serial_ctrl_register_port+0x10/0x1c
>> uart_add_one_port+0x10/0x1c
>> s3c24xx_serial_probe+0x34c/0x6d8
>> platform_probe+0x5c/0xac
>> really_probe+0xbc/0x298
>> __driver_probe_device+0x78/0x12c
>> driver_probe_device+0xdc/0x164
>> __device_attach_driver+0xb8/0x138
>> bus_for_each_drv+0x80/0xdc
>> __device_attach+0xa8/0x1b0
>> device_initial_probe+0x14/0x20
>> bus_probe_device+0xb0/0xb4
>> deferred_probe_work_func+0x8c/0xc8
>> process_one_work+0x208/0x60c
>> worker_thread+0x244/0x388
>> kthread+0x150/0x228
>> ret_from_fork+0x10/0x20
>>
>> -> #1 (console_owner){..-.}-{0:0}:
>> console_lock_spinning_enable+0x6c/0x7c
>> console_flush_all+0x2c8/0x49c
>> console_unlock+0x70/0x110
>> vprintk_emit+0x254/0x39c
>> vprintk_default+0x38/0x44
>> vprintk+0x28/0x34
>> _printk+0x5c/0x84
>> exynos_wkup_irq_set_wake+0x80/0xa4
>> irq_set_irq_wake+0x164/0x1e0
>> arizona_irq_set_wake+0x18/0x24
>> irq_set_irq_wake+0x164/0x1e0
>> regmap_irq_sync_unlock+0x328/0x530
>> __irq_put_desc_unlock+0x48/0x4c
>> irq_set_irq_wake+0x84/0x1e0
>> arizona_set_irq_wake+0x5c/0x70
>> wm5110_probe+0x220/0x354 [snd_soc_wm5110]
>> platform_probe+0x5c/0xac
>> really_probe+0xbc/0x298
>> __driver_probe_device+0x78/0x12c
>> driver_probe_device+0xdc/0x164
>> __driver_attach+0x9c/0x1ac
>> bus_for_each_dev+0x74/0xd0
>> driver_attach+0x24/0x30
>> bus_add_driver+0xe4/0x208
>> driver_register+0x60/0x128
>> __platform_driver_register+0x24/0x30
>> cs_exit+0xc/0x20 [cpufreq_conservative]
>> do_one_initcall+0x64/0x308
>> do_init_module+0x58/0x23c
>> load_module+0x1b48/0x1dc4
>> init_module_from_file+0x84/0xc4
>> idempotent_init_module+0x188/0x280
>> __arm64_sys_finit_module+0x68/0xac
>> invoke_syscall+0x48/0x110
>> el0_svc_.common.c
>>
>> (system is frozen at this point).
> So I've seen issues like this when testing scheduler changes,
> particularly when I've added debug printks or WARN_ONs that trip while
> we're deep in the scheduler core and hold various locks. I reported
> something similar here:
> https://lore.kernel.org/lkml/CANDhNCo8NRm4meR7vHqvP8vVZ-_GXVPuUKSO1wUQkKdfjvy20w@mail.gmail.com/
>
> Now, usually I'll see the lockdep warning, and the hang is much more rare.
>
> But I don't see right off how the dl_server change would affect this,
> other than just changing the timing of execution such that you manage
> to trip over the existing issue.
>
> So far I don't see anything similar testing hotplug on x86 qemu. Do
> you get any other console messages or warnings prior?
Nope. But the most suspicious message that is there is the 'CPU7: Booted
secondary processor 0x0000000101' line, which I got while off-lining all
non-zero CPUs.
> Looking at the backtrace, I wonder if changing the pr_info() in
> exynos_wkup_irq_set_wake() to printk_deferred() might avoid this?
I've removed that pr_info() from exynos_wkup_irq_set_wake() completely
and now I get the following warning:
# for i in /sys/devices/system/cpu/cpu[1-9]; do echo 0 >$i/online; done
# Detected VIPT I-cache on CPU7
CPU7: Booted secondary processor 0x0000000101 [0x410fd031]
------------[ cut here ]------------
WARNING: CPU: 7 PID: 0 at kernel/rcu/tree.c:4329
rcutree_report_cpu_starting+0x1e8/0x348
Modules linked in: brcmfmac_wcc brcmfmac brcmutil sha256
cpufreq_powersave cpufreq_conservative cfg80211 snd_soc_tm2_wm5110
hci_uart btqca btbcm s3fwrn5_i2c snd_soc_wm5110 bluetooth
arizona_micsupp phy_exynos5_usbdrd s3fwrn5 s5p_mfc nci typec
snd_soc_wm_adsp s5p_jpeg cs_dsp nfc ecdh_generic max77693_haptic
snd_soc_arizona arizona_ldo1 ecc rfkill snd_soc_i2s snd_soc_idma
snd_soc_max98504 snd_soc_hdmi_codec snd_soc_s3c_dma pwrseq_core
snd_soc_core exynos_gsc ir_spi v4l2_mem2mem videobuf2_dma_contig
videobuf2_memops snd_compress snd_pcm_dmaengine videobuf2_v4l2 videodev
ntc_thermistor snd_pcm panfrost videobuf2_common drm_shmem_helper
gpu_sched snd_timer mc panel_samsung_s6e3ha2 backlight snd soundcore ipv6
CPU: 7 UID: 0 PID: 0 Comm: swapper/7 Not tainted 6.17.0-rc6+ #16014
PREEMPT
Hardware name: Samsung TM2E board (DT)
Hardware name: Samsung TM2E board (DT)
Detected VIPT I-cache on CPU7
CPU7: Booted secondary processor 0x0000000103 [0x410fd031]
================================
WARNING: inconsistent lock state
6.17.0-rc6+ #16014 Not tainted
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
swapper/7/0 [HC0[0]:SC0[0]:HE0:SE1] takes:
ffff800083e479c0 (&port_lock_key){?.-.}-{3:3}, at:
s3c24xx_serial_console_write+0x80/0x268
{IN-HARDIRQ-W} state was registered at:
lock_acquire+0x1c8/0x354
_raw_spin_lock+0x48/0x60
s3c64xx_serial_handle_irq+0x6c/0x164
__handle_irq_event_percpu+0x9c/0x2d8
handle_irq_event+0x4c/0xac
handle_fasteoi_irq+0x108/0x198
handle_irq_desc+0x40/0x58
generic_handle_domain_irq+0x1c/0x28
gic_handle_irq+0x40/0xc8
call_on_irq_stack+0x30/0x48
do_interrupt_handler+0x80/0x84
el1_interrupt+0x34/0x64
el1h_64_irq_handler+0x18/0x24
el1h_64_irq+0x6c/0x70
default_idle_call+0xac/0x26c
do_idle+0x220/0x284
cpu_startup_entry+0x38/0x3c
rest_init+0xf4/0x184
start_kernel+0x70c/0x7d4
__primary_switched+0x88/0x90
irq event stamp: 63878
hardirqs last enabled at (63877): [<ffff800080121d2c>]
do_idle+0x220/0x284
hardirqs last disabled at (63878): [<ffff80008132f3a4>]
el1_brk64+0x1c/0x54
softirqs last enabled at (63812): [<ffff8000800c1164>]
handle_softirqs+0x4c4/0x4dc
softirqs last disabled at (63807): [<ffff800080010690>]
__do_softirq+0x14/0x20
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&port_lock_key);
<Interrupt>
lock(&port_lock_key);
*** DEADLOCK ***
5 locks held by swapper/7/0:
#0: ffff800082d0aa98 (console_lock){+.+.}-{0:0}, at:
vprintk_emit+0x150/0x39c
#1: ffff800082d0aaf0 (console_srcu){....}-{0:0}, at:
console_flush_all+0x78/0x49c
#2: ffff800082d0acb0 (console_owner){+.-.}-{0:0}, at:
console_lock_spinning_enable+0x48/0x7c
#3: ffff800082d0acd8
(printk_legacy_map-wait-type-override){+...}-{4:4}, at:
console_flush_all+0x2b0/0x49c
#4: ffff800083e479c0 (&port_lock_key){?.-.}-{3:3}, at:
s3c24xx_serial_console_write+0x80/0x268
stack backtrace:
CPU: 7 UID: 0 PID: 0 Comm: swapper/7 Not tainted 6.17.0-rc6+ #16014
PREEMPT
Hardware name: Samsung TM2E board (DT)
Call trace:
show_stack+0x18/0x24 (C)
dump_stack_lvl+0x90/0xd0
dump_stack+0x18/0x24
print_usage_bug.part.0+0x29c/0x358
mark_lock+0x7bc/0x960
mark_held_locks+0x58/0x90
lockdep_hardirqs_on_prepare+0x104/0x214
trace_hardirqs_on+0x58/0x1d8
secondary_start_kernel+0x134/0x160
__secondary_switched+0xc0/0xc4
------------[ cut here ]------------
WARNING: CPU: 7 PID: 0 at kernel/context_tracking.c:127
ct_kernel_exit.constprop.0+0x120/0x184
Modules linked in: brcmfmac_wcc brcmfmac brcmutil sha256
cpufreq_powersave cpufreq_conservative cfg80211 snd_soc_tm2_wm5110
hci_uart btqca btbcm s3fwrn5_i2c snd_soc_wm5110 bluetooth
arizona_micsupp phy_exynos5_usbdrd s3fwrn5 s5p_mfc nci typec
snd_soc_wm_adsp s5p_jpeg cs_dsp nfc ecdh_generic max77693_haptic
snd_soc_arizona arizona_ldo1 ecc rfkill snd_soc_i2s snd_soc_idma
snd_soc_max98504 snd_soc_hdmi_c
(no more messages, system frozen)
It looks that offlining CPUs 1-7 was successful (there is a prompt char
in the second line), but then CPU7 got somehow onlined again, what
causes this freeze.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2025-09-23 6:31 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 11:49 [PATCH v2 00/12] sched: Address schbench regression Peter Zijlstra
2025-07-02 11:49 ` [PATCH v2 01/12] sched/psi: Optimize psi_group_change() cpu_clock() usage Peter Zijlstra
2025-07-15 19:11 ` Chris Mason
2025-07-16 6:06 ` K Prateek Nayak
2025-07-16 6:53 ` Beata Michalska
2025-07-16 10:40 ` Peter Zijlstra
2025-07-16 14:54 ` Johannes Weiner
2025-07-16 16:27 ` Chris Mason
2025-07-23 4:16 ` Aithal, Srikanth
2025-07-25 5:13 ` K Prateek Nayak
2025-07-02 11:49 ` [PATCH v2 02/12] sched/deadline: Less agressive dl_server handling Peter Zijlstra
2025-07-02 16:12 ` Juri Lelli
2025-07-10 12:46 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2025-07-14 22:56 ` [PATCH v2 02/12] " Mel Gorman
2025-07-15 14:55 ` Chris Mason
2025-07-16 18:19 ` Mel Gorman
2025-07-30 9:34 ` Geert Uytterhoeven
2025-07-30 9:46 ` Juri Lelli
2025-07-30 10:05 ` Geert Uytterhoeven
2025-08-05 22:03 ` Chris Bainbridge
2025-08-05 23:04 ` Chris Bainbridge
2025-09-15 22:29 ` John Stultz
2025-09-16 4:18 ` John Stultz
2025-09-16 5:28 ` [RFC][PATCH] sched/deadline: Fix dl_server getting stuck, allowing cpu starvation John Stultz
2025-09-16 8:51 ` Juri Lelli
2025-09-16 11:01 ` Peter Zijlstra
2025-09-16 12:52 ` Juri Lelli
2025-09-16 14:30 ` Peter Zijlstra
2025-09-16 17:35 ` John Stultz
2025-09-16 21:30 ` Peter Zijlstra
2025-09-17 3:29 ` John Stultz
2025-09-17 9:34 ` Peter Zijlstra
2025-09-17 12:26 ` Peter Zijlstra
2025-09-17 13:56 ` Juri Lelli
2025-09-17 17:30 ` Peter Zijlstra
2025-09-18 8:37 ` Juri Lelli
2025-09-18 9:04 ` Peter Zijlstra
2025-09-18 9:42 ` Juri Lelli
2025-09-17 19:29 ` John Stultz
2025-09-18 6:56 ` [tip: sched/urgent] sched/deadline: Fix dl_server behaviour tip-bot2 for Peter Zijlstra
2025-09-25 7:55 ` tip-bot2 for Peter Zijlstra
2025-09-18 6:56 ` [tip: sched/urgent] sched/deadline: Fix dl_server getting stuck tip-bot2 for Peter Zijlstra
2025-09-18 14:46 ` Dietmar Eggemann
[not found] ` <CGME20250922215704eucas1p1f53a65a5cd1eafd3e0db006653231efd@eucas1p1.samsung.com>
2025-09-22 21:57 ` Marek Szyprowski
2025-09-22 23:46 ` John Stultz
2025-09-23 6:31 ` Marek Szyprowski [this message]
2025-09-23 7:25 ` Peter Zijlstra
2025-09-23 7:52 ` Marek Szyprowski
2025-09-23 22:02 ` Peter Zijlstra
2025-09-29 15:19 ` Marek Szyprowski
[not found] ` <eae77bd0-d874-4ddf-88d7-c1ab75358f91@samsung.com>
2025-10-09 8:35 ` Krzysztof Kozlowski
2025-10-09 9:26 ` Peter Zijlstra
2025-10-09 11:42 ` Marek Szyprowski
2025-09-25 7:55 ` tip-bot2 for Peter Zijlstra
2025-07-02 11:49 ` [PATCH v2 03/12] sched: Optimize ttwu() / select_task_rq() Peter Zijlstra
2025-07-10 16:47 ` Vincent Guittot
2025-07-14 22:59 ` Mel Gorman
2025-07-02 11:49 ` [PATCH v2 04/12] sched: Use lock guard in ttwu_runnable() Peter Zijlstra
2025-07-10 16:48 ` Vincent Guittot
2025-07-14 23:00 ` Mel Gorman
2025-07-02 11:49 ` [PATCH v2 05/12] sched: Add ttwu_queue controls Peter Zijlstra
2025-07-10 16:51 ` Vincent Guittot
2025-07-14 23:14 ` Mel Gorman
2025-07-02 11:49 ` [PATCH v2 06/12] sched: Introduce ttwu_do_migrate() Peter Zijlstra
2025-07-10 16:51 ` Vincent Guittot
2025-07-02 11:49 ` [PATCH v2 07/12] psi: Split psi_ttwu_dequeue() Peter Zijlstra
2025-07-17 23:59 ` Chris Mason
2025-07-18 18:02 ` Steven Rostedt
2025-07-02 11:49 ` [PATCH v2 08/12] sched: Re-arrange __ttwu_queue_wakelist() Peter Zijlstra
2025-07-02 11:49 ` [PATCH v2 09/12] sched: Clean up ttwu comments Peter Zijlstra
2025-07-02 11:49 ` [PATCH v2 10/12] sched: Use lock guard in sched_ttwu_pending() Peter Zijlstra
2025-07-10 16:51 ` Vincent Guittot
2025-07-02 11:49 ` [PATCH v2 11/12] sched: Change ttwu_runnable() vs sched_delayed Peter Zijlstra
2025-07-02 11:49 ` [PATCH v2 12/12] sched: Add ttwu_queue support for delayed tasks Peter Zijlstra
2025-07-03 16:00 ` Phil Auld
2025-07-03 16:47 ` Peter Zijlstra
2025-07-03 17:11 ` Phil Auld
2025-07-14 13:57 ` Phil Auld
2025-07-04 6:13 ` K Prateek Nayak
2025-07-04 7:59 ` Peter Zijlstra
2025-07-08 12:44 ` Dietmar Eggemann
2025-07-08 18:57 ` Peter Zijlstra
2025-07-08 21:02 ` Peter Zijlstra
2025-07-23 5:42 ` Shrikanth Hegde
2025-07-02 15:27 ` [PATCH v2 00/12] sched: Address schbench regression Chris Mason
2025-07-07 9:05 ` Shrikanth Hegde
2025-07-07 9:11 ` Peter Zijlstra
2025-07-07 9:38 ` Shrikanth Hegde
2025-07-16 13:46 ` Phil Auld
2025-07-17 17:25 ` Phil Auld
2025-07-07 18:19 ` Shrikanth Hegde
2025-07-08 19:02 ` Peter Zijlstra
2025-07-09 16:46 ` Shrikanth Hegde
2025-07-14 17:54 ` Shrikanth Hegde
2025-07-21 19:37 ` Shrikanth Hegde
2025-07-22 20:20 ` Chris Mason
2025-07-24 18:23 ` Chris Mason
2025-07-08 15:09 ` Chris Mason
2025-07-08 17:29 ` Shrikanth Hegde
2025-07-17 13:04 ` Beata Michalska
2025-07-17 16:57 ` Beata Michalska
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=47563570-7339-43da-af15-4acf7b93075c@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=jstultz@google.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®