Re: [tip: sched/urgent] sched/core: Avoid spurious lock dependencies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip: sched/urgent] sched/core: Avoid spurious lock dependencies
- From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
- Date: Fri, 22 Nov 2019 21:01:22 +0100
- Cc: linux-tip-commits@xxxxxxxxxxxxxxx, "Peter Zijlstra (Intel)" <peterz@xxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, Qian Cai <cai@xxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, akpm@xxxxxxxxxxxxxxxxxxxx, cl@xxxxxxxxx, keescook@xxxxxxxxxxxx, penberg@xxxxxxxxxx, rientjes@xxxxxxxxxx, thgarnie@xxxxxxxxxx, tytso@xxxxxxx, will@xxxxxxxxxx, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>
- In-reply-to: <157363958888.29376.9190587096871610849.tip-bot2@tip-bot2>
- References: <20191001091837.GK4536@hirez.programming.kicks-ass.net> <157363958888.29376.9190587096871610849.tip-bot2@tip-bot2>
On 2019-11-13 10:06:28 [-0000], tip-bot2 for Peter Zijlstra wrote:
> sched/core: Avoid spurious lock dependencies
>
> While seemingly harmless, __sched_fork() does hrtimer_init(), which,
> when DEBUG_OBJETS, can end up doing allocations.
>
> This then results in the following lock order:
>
> rq->lock
> zone->lock.rlock
> batched_entropy_u64.lock
>
> Which in turn causes deadlocks when we do wakeups while holding that
> batched_entropy lock -- as the random code does.
Peter, can it _really_ cause deadlocks? My understanding was that the
batched_entropy_u64.lock is a per-CPU lock and can _not_ cause a
deadlock because it can be always acquired on multiple CPUs
simultaneously (and it is never acquired cross-CPU).
Lockdep is simply not smart enough to see that and complains about it
like it would complain about a regular lock in this case.
Sebastian
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]