<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/locking/lockdep.c, branch v5.12</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-03-22T21:07:09Z</updated>
<entry>
<title>lockdep: Address clang -Wformat warning printing for %hd</title>
<updated>2021-03-22T21:07:09Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-03-22T11:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d48b7912cc72275dc7c59ff961c8bac7ef66a92'/>
<id>urn:sha1:6d48b7912cc72275dc7c59ff961c8bac7ef66a92</id>
<content type='text'>
Clang doesn't like format strings that truncate a 32-bit
value to something shorter:

  kernel/locking/lockdep.c:709:4: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat]

In this case, the warning is a slightly questionable, as it could realize
that both class-&gt;wait_type_outer and class-&gt;wait_type_inner are in fact
8-bit struct members, even though the result of the ?: operator becomes an
'int'.

However, there is really no point in printing the number as a 16-bit
'short' rather than either an 8-bit or 32-bit number, so just change
it to a normal %d.

Fixes: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20210322115531.3987555-1-arnd@kernel.org
</content>
</entry>
<entry>
<title>lockdep: Add a missing initialization hint to the "INFO: Trying to register non-static key" message</title>
<updated>2021-03-21T10:59:57Z</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2021-03-21T06:49:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a85969e9d912d5dd85362ee37b5f81266e00e77'/>
<id>urn:sha1:3a85969e9d912d5dd85362ee37b5f81266e00e77</id>
<content type='text'>
Since this message is printed when dynamically allocated spinlocks (e.g.
kzalloc()) are used without initialization (e.g. spin_lock_init()),
suggest to developers to check whether initialization functions for objects
were called, before making developers wonder what annotation is missing.

[ mingo: Minor tweaks to the message. ]

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lore.kernel.org/r/20210321064913.4619-1-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' into locking/core, to pick up upstream fixes</title>
<updated>2021-02-12T11:54:58Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2021-02-12T11:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=62137364e3e8afcc745846c5c67cacf943149073'/>
<id>urn:sha1:62137364e3e8afcc745846c5c67cacf943149073</id>
<content type='text'>
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>locking/lockdep: Avoid unmatched unlock</title>
<updated>2021-02-05T16:20:15Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2021-02-01T10:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f82e631d236cafd28518b998c6d4d8dc2ef68f6'/>
<id>urn:sha1:7f82e631d236cafd28518b998c6d4d8dc2ef68f6</id>
<content type='text'>
Commit f6f48e180404 ("lockdep: Teach lockdep about "USED" &lt;- "IN-NMI"
inversions") overlooked that print_usage_bug() releases the graph_lock
and called it without the graph lock held.

Fixes: f6f48e180404 ("lockdep: Teach lockdep about "USED" &lt;- "IN-NMI" inversions")
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Link: https://lkml.kernel.org/r/YBfkuyIfB1+VRxXP@hirez.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>locking/lockdep: Exclude local_lock_t from IRQ inversions</title>
<updated>2021-01-14T10:20:17Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-12-10T10:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f2962401c6e195222f320d12b3a55377b2d4653'/>
<id>urn:sha1:5f2962401c6e195222f320d12b3a55377b2d4653</id>
<content type='text'>
The purpose of local_lock_t is to abstract: preempt_disable() /
local_bh_disable() / local_irq_disable(). These are the traditional
means of gaining access to per-cpu data, but are fundamentally
non-preemptible.

local_lock_t provides a per-cpu lock, that on !PREEMPT_RT reduces to
no-ops, just like regular spinlocks do on UP.

This gives rise to:

	CPU0			CPU1

	local_lock(B)		spin_lock_irq(A)
	&lt;IRQ&gt;
	  spin_lock(A)		local_lock(B)

Where lockdep then figures things will lock up; which would be true if
B were any other kind of lock. However this is a false positive, no
such deadlock actually exists.

For !RT the above local_lock(B) is preempt_disable(), and there's
obviously no deadlock; alternatively, CPU0's B != CPU1's B.

For RT the argument is that since local_lock() nests inside
spin_lock(), it cannot be used in hardirq context, and therefore CPU0
cannot in fact happen. Even though B is a real lock, it is a
preemptible lock and any threaded-irq would simply schedule out and
let the preempted task (which holds B) continue such that the task on
CPU1 can make progress, after which the threaded-irq resumes and can
finish.

This means that we can never form an IRQ inversion on a local_lock
dependency, so terminate the graph walk when looking for IRQ
inversions when we encounter one.

One consequence is that (for LOCKDEP_SMALL) when we look for redundant
dependencies, A -&gt; B is not redundant in the presence of A -&gt; L -&gt; B.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
[peterz: Changelog]
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>locking/lockdep: Clean up check_redundant() a bit</title>
<updated>2021-01-14T10:20:17Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-12-10T10:16:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=175b1a60e8805617d74aefe17ce0d3a32eceb55c'/>
<id>urn:sha1:175b1a60e8805617d74aefe17ce0d3a32eceb55c</id>
<content type='text'>
In preparation for adding an TRACE_IRQFLAGS dependent skip function to
check_redundant(), move it below the TRACE_IRQFLAGS #ifdef.

While there, provide a stub function to reduce #ifdef usage.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>locking/lockdep: Add a skip() function to __bfs()</title>
<updated>2021-01-14T10:20:17Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-12-10T10:02:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc2dd71b283665f0a409d5b6fc603d5a6fdc219e'/>
<id>urn:sha1:bc2dd71b283665f0a409d5b6fc603d5a6fdc219e</id>
<content type='text'>
Some __bfs() walks will have additional iteration constraints (beyond
the path being strong). Provide an additional function to allow
terminating graph walks.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>locking/lockdep: Mark local_lock_t</title>
<updated>2021-01-14T10:20:17Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-12-09T15:06:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dfd5e3f5fe27bda91d5cc028c86ffbb7a0614489'/>
<id>urn:sha1:dfd5e3f5fe27bda91d5cc028c86ffbb7a0614489</id>
<content type='text'>
The local_lock_t's are special, because they cannot form IRQ
inversions, make sure we can tell them apart from the rest of the
locks.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>locking/lockdep: Avoid noinstr warning for DEBUG_LOCKDEP</title>
<updated>2021-01-12T20:10:59Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2021-01-06T14:36:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77ca93a6b1223e210e58e1000c09d8d420403c94'/>
<id>urn:sha1:77ca93a6b1223e210e58e1000c09d8d420403c94</id>
<content type='text'>
  vmlinux.o: warning: objtool: lock_is_held_type()+0x60: call to check_flags.part.0() leaves .noinstr.text section

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210106144017.652218215@infradead.org

</content>
</entry>
<entry>
<title>locking/lockdep: Cure noinstr fail</title>
<updated>2021-01-12T20:10:59Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2021-01-06T14:36:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0afda3a888dccf12557b41ef42eee942327d122b'/>
<id>urn:sha1:0afda3a888dccf12557b41ef42eee942327d122b</id>
<content type='text'>
When the compiler doesn't feel like inlining, it causes a noinstr
fail:

  vmlinux.o: warning: objtool: lock_is_held_type()+0xb: call to lockdep_enabled() leaves .noinstr.text section

Fixes: 4d004099a668 ("lockdep: Fix lockdep recursion")
Reported-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210106144017.592595176@infradead.org

</content>
</entry>
</feed>
