public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+ca14b36a46a8c541b509@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	Daniel Bristot de Oliveira <bristot@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	vincent.guittot@linaro.org
Subject: Re: [syzbot] [cgroups?] possible deadlock in task_rq_lock
Date: Sun, 18 Aug 2024 06:53:56 +0800	[thread overview]
Message-ID: <20240817225356.730-1-hdanton@sina.com> (raw)
In-Reply-To: <00000000000092ef86061fdb849b@google.com>

On Fri, 16 Aug 2024 23:52:22 -0700
>
>-> #0 ((console_sem).lock){-.-.}-{2:2}:
>       check_prev_add kernel/locking/lockdep.c:3136 [inline]
>       check_prevs_add kernel/locking/lockdep.c:3255 [inline]
>       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3871
>       __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145
>       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762
>       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
>       _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
>       down_trylock+0x20/0xa0 kernel/locking/semaphore.c:139
>       __down_trylock_console_sem+0x109/0x250 kernel/printk/printk.c:323
>       console_trylock kernel/printk/printk.c:2754 [inline]
>       console_trylock_spinning kernel/printk/printk.c:1958 [inline]
>       vprintk_emit+0x2aa/0x7c0 kernel/printk/printk.c:2347
>       _printk+0xd5/0x120 kernel/printk/printk.c:2373
>       __report_bug lib/bug.c:195 [inline]
>       report_bug+0x346/0x500 lib/bug.c:219
>       handle_bug+0x60/0x90 arch/x86/kernel/traps.c:285
>       exc_invalid_op+0x1a/0x50 arch/x86/kernel/traps.c:309
>       asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:621
>       lockdep_assert_rq_held kernel/sched/sched.h:1476 [inline]

It looks no way to me to fix the lockdep assert without breaking the safe
locking order in double_rq_lock().

>       rq_clock kernel/sched/sched.h:1624 [inline]
>       replenish_dl_new_period kernel/sched/deadline.c:777 [inline]
>       update_curr_dl_se+0x66f/0x920 kernel/sched/deadline.c:1511
>       update_curr+0x575/0xb20 kernel/sched/fair.c:1176
>       put_prev_entity+0x3d/0x210 kernel/sched/fair.c:5505
>       put_prev_task_fair+0x4d/0x80 kernel/sched/fair.c:8686
>       put_prev_task kernel/sched/sched.h:2423 [inline]
>       put_prev_task_balance+0x11d/0x190 kernel/sched/core.c:5886
>       __pick_next_task+0xc6/0x2f0 kernel/sched/core.c:5946
>       pick_next_task kernel/sched/core.c:6012 [inline]
>       __schedule+0x725/0x4ad0 kernel/sched/core.c:6594
>       preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:6961
>       irqentry_exit+0x5e/0x90 kernel/entry/common.c:354
>       asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:707
>       lock_acquire+0x264/0x550 kernel/locking/lockdep.c:5766
>       down_read_trylock+0x24f/0x3c0 kernel/locking/rwsem.c:1568
>       mmap_read_trylock include/linux/mmap_lock.h:163 [inline]
>       get_mmap_lock_carefully mm/memory.c:6033 [inline]
>       lock_mm_and_find_vma+0x32/0x2f0 mm/memory.c:6093
>       do_user_addr_fault arch/x86/mm/fault.c:1361 [inline]
>       handle_page_fault arch/x86/mm/fault.c:1481 [inline]
>       exc_page_fault+0x1bf/0x8c0 arch/x86/mm/fault.c:1539
>       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
>       __put_user_4+0x11/0x20 arch/x86/lib/putuser.S:86
>       schedule_tail+0x96/0xb0 kernel/sched/core.c:5205
>       ret_from_fork+0x24/0x80 arch/x86/kernel/process.c:143
>       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

  parent reply	other threads:[~2024-08-17 23:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16  5:50 [syzbot] [cgroups?] possible deadlock in task_rq_lock syzbot
2024-08-17  6:52 ` syzbot
2024-08-17  8:31   ` Hillf Danton
2024-08-17 10:09     ` syzbot
2024-08-17 11:57   ` Hillf Danton
2024-08-17 12:23     ` syzbot
2024-08-17 22:53   ` Hillf Danton [this message]
2024-08-18  7:05 ` syzbot

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=20240817225356.730-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=syzbot+ca14b36a46a8c541b509@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vincent.guittot@linaro.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