<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/locking-selftest.c, branch v5.11</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.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-12-15T20:53:37Z</updated>
<entry>
<title>Merge branch 'akpm' (patches from Andrew)</title>
<updated>2020-12-15T20:53:37Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-12-15T20:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac73e3dc8acd0a3be292755db30388c3580f5674'/>
<id>urn:sha1:ac73e3dc8acd0a3be292755db30388c3580f5674</id>
<content type='text'>
Merge misc updates from Andrew Morton:

 - a few random little subsystems

 - almost all of the MM patches which are staged ahead of linux-next
   material. I'll trickle to post-linux-next work in as the dependents
   get merged up.

Subsystems affected by this patch series: kthread, kbuild, ide, ntfs,
ocfs2, arch, and mm (slab-generic, slab, slub, dax, debug, pagecache,
gup, swap, shmem, memcg, pagemap, mremap, hmm, vmalloc, documentation,
kasan, pagealloc, memory-failure, hugetlb, vmscan, z3fold, compaction,
oom-kill, migration, cma, page-poison, userfaultfd, zswap, zsmalloc,
uaccess, zram, and cleanups).

* emailed patches from Andrew Morton &lt;akpm@linux-foundation.org&gt;: (200 commits)
  mm: cleanup kstrto*() usage
  mm: fix fall-through warnings for Clang
  mm: slub: convert sysfs sprintf family to sysfs_emit/sysfs_emit_at
  mm: shmem: convert shmem_enabled_show to use sysfs_emit_at
  mm:backing-dev: use sysfs_emit in macro defining functions
  mm: huge_memory: convert remaining use of sprintf to sysfs_emit and neatening
  mm: use sysfs_emit for struct kobject * uses
  mm: fix kernel-doc markups
  zram: break the strict dependency from lzo
  zram: add stat to gather incompressible pages since zram set up
  zram: support page writeback
  mm/process_vm_access: remove redundant initialization of iov_r
  mm/zsmalloc.c: rework the list_add code in insert_zspage()
  mm/zswap: move to use crypto_acomp API for hardware acceleration
  mm/zswap: fix passing zero to 'PTR_ERR' warning
  mm/zswap: make struct kernel_param_ops definitions const
  userfaultfd/selftests: hint the test runner on required privilege
  userfaultfd/selftests: fix retval check for userfaultfd_open()
  userfaultfd/selftests: always dump something in modes
  userfaultfd: selftests: make __{s,u}64 format specifiers portable
  ...
</content>
</entry>
<entry>
<title>locking/selftests: add testcases for fs_reclaim</title>
<updated>2020-12-15T20:13:41Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-12-15T03:08:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5037d1d82b39d70e2f5952528f24172f33f5629'/>
<id>urn:sha1:d5037d1d82b39d70e2f5952528f24172f33f5629</id>
<content type='text'>
Since I butchered this I figured better to make sure we have testcases for
this now.  Since we only have a locking context for __GFP_FS that's the
only thing we're testing right now.

Link: https://lkml.kernel.org/r/20201125162532.1299794-4-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Cc: Qian Cai &lt;cai@lca.pw&gt;
Cc: Thomas Hellström (Intel) &lt;thomas_os@shipmail.org&gt;
Cc: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: "Matthew Wilcox (Oracle)" &lt;willy@infradead.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Cc: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Michel Lespinasse &lt;walken@google.com&gt;
Cc: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep/selftest: Add spin_nest_lock test</title>
<updated>2020-12-03T10:20:50Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-11-02T05:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e04ce676e7aa490dcf5df880592e3db5e842a9bc'/>
<id>urn:sha1:e04ce676e7aa490dcf5df880592e3db5e842a9bc</id>
<content type='text'>
Add a self test case to test the behavior for the following case:

	lock(A);
	lock_nest_lock(C1, A);
	lock(B);
	lock_nest_lock(C2, A);

This is a reproducer for a problem[1] reported by Chris Wilson, and is
helpful to prevent this.

[1]: https://lore.kernel.org/lkml/160390684819.31966.12048967113267928793@build.alporthouse.com/

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20201102053743.450459-2-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>lockdep/selftests: Fix PROVE_RAW_LOCK_NESTING</title>
<updated>2020-12-03T10:20:50Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-10-30T11:37:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2e9ae58d5042b3aa4a61f676ff6975ff3bc7bc7'/>
<id>urn:sha1:a2e9ae58d5042b3aa4a61f676ff6975ff3bc7bc7</id>
<content type='text'>
The selftest nests rwlock_t inside raw_spinlock_t, this is invalid.

Reported-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>lockdep/selftest: Introduce recursion3</title>
<updated>2020-08-26T10:42:08Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=96a16f45aed89cf024606a11679b0609d09552c7'/>
<id>urn:sha1:96a16f45aed89cf024606a11679b0609d09552c7</id>
<content type='text'>
Add a test case shows that USED_IN_*_READ and ENABLE_*_READ can cause
deadlock too.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-20-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>locking/selftest: Add test cases for queued_read_lock()</title>
<updated>2020-08-26T10:42:07Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ad56450db86413ff911eb527b5a49e04a4345e61'/>
<id>urn:sha1:ad56450db86413ff911eb527b5a49e04a4345e61</id>
<content type='text'>
Add two self test cases for the following case:

	P0:			P1:			P2:

				&lt;in irq handler&gt;
	spin_lock_irq(&amp;slock)	read_lock(&amp;rwlock)
							write_lock_irq(&amp;rwlock)
	read_lock(&amp;rwlock)	spin_lock(&amp;slock)

, which is a deadlock, as the read_lock() on P0 cannot get the lock
because of the fairness.

	P0:			P1:			P2:

	&lt;in irq handler&gt;
	spin_lock(&amp;slock)	read_lock(&amp;rwlock)
							write_lock(&amp;rwlock)
	read_lock(&amp;rwlock)	spin_lock_irq(&amp;slock)

, which is not a deadlock, as the read_lock() on P0 can get the lock
because it could use the unfair fastpass.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-19-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>Revert "locking/lockdep/selftests: Fix mixed read-write ABBA tests"</title>
<updated>2020-08-26T10:42:07Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=108dc42ed3507fe06214d51ab15fca7771df8bbd'/>
<id>urn:sha1:108dc42ed3507fe06214d51ab15fca7771df8bbd</id>
<content type='text'>
This reverts commit d82fed75294229abc9d757f08a4817febae6c4f4.

Since we now could handle mixed read-write deadlock detection well, the
self tests could be detected as expected, no need to use this
work-around.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-18-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>lockdep/selftest: Add more recursive read related test cases</title>
<updated>2020-08-26T10:42:07Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ef7ca75120a39167def40f41daefee013c4b5af'/>
<id>urn:sha1:8ef7ca75120a39167def40f41daefee013c4b5af</id>
<content type='text'>
Add those four test cases:

1.	X --(ER)--&gt; Y --(ER)--&gt; Z --(ER)--&gt; X is deadlock.

2.	X --(EN)--&gt; Y --(SR)--&gt; Z --(ER)--&gt; X is deadlock.

3.	X --(EN)--&gt; Y --(SR)--&gt; Z --(SN)--&gt; X is not deadlock.

4.	X --(ER)--&gt; Y --(SR)--&gt; Z --(EN)--&gt; X is not deadlock.

Those self testcases are valuable for the development of supporting
recursive read related deadlock detection.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-17-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>lockdep/selftest: Unleash irq_read_recursion2 and add more</title>
<updated>2020-08-26T10:42:06Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=31e0d747708272356bee9b6a1b90c1e6525b0f6d'/>
<id>urn:sha1:31e0d747708272356bee9b6a1b90c1e6525b0f6d</id>
<content type='text'>
Now since we can handle recursive read related irq inversion deadlocks
correctly, uncomment the irq_read_recursion2 and add more testcases.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-16-boqun.feng@gmail.com
</content>
</entry>
<entry>
<title>lockdep/selftest: Add a R-L/L-W test case specific to chain cache behavior</title>
<updated>2020-08-26T10:42:06Z</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2020-08-07T07:42:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4f200e579e96051f1f081f795820787826eb234'/>
<id>urn:sha1:d4f200e579e96051f1f081f795820787826eb234</id>
<content type='text'>
As our chain cache doesn't differ read/write locks, so even we can
detect a read-lock/lock-write deadlock in check_noncircular(), we can
still be fooled if a read-lock/lock-read case(which is not a deadlock)
comes first.

So introduce this test case to test specific to the chain cache behavior
on detecting recursive read lock related deadlocks.

Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20200807074238.1632519-14-boqun.feng@gmail.com
</content>
</entry>
</feed>
