<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/radix-tree, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-07-10T07:52:21Z</updated>
<entry>
<title>idr: Fix idr_get_next race with idr_remove</title>
<updated>2019-07-10T07:52:21Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2019-05-14T20:05:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c6e2eab05915e56767198b688c020b9b8f6d35ca'/>
<id>urn:sha1:c6e2eab05915e56767198b688c020b9b8f6d35ca</id>
<content type='text'>
commit 5c089fd0c73411f2170ab795c9ffc16718c7d007 upstream.

If the entry is deleted from the IDR between the call to
radix_tree_iter_find() and rcu_dereference_raw(), idr_get_next()
will return NULL, which will end the iteration prematurely.  We should
instead continue to the next entry in the IDR.  This only happens if the
iteration is protected by the RCU lock.  Most IDR users use a spinlock
or semaphore to exclude simultaneous modifications.  It was noticed once
the PID allocator was converted to use the IDR, as it uses the RCU lock,
but there may be other users elsewhere in the kernel.

We can't use the normal pattern of calling radix_tree_deref_retry()
(which catches both a retry entry in a leaf node and a node entry in
the root) as the IDR supports storing entries which are unaligned,
which will trigger an infinite loop if they are encountered.  Instead,
we have to explicitly check whether the entry is a retry entry.

Fixes: 0a835c4f090a ("Reimplement IDR and IDA using the radix tree")
Reported-by: Brendan Gregg &lt;bgregg@netflix.com&gt;
Tested-by: Brendan Gregg &lt;bgregg@netflix.com&gt;
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>radix tree: Don't return retry entries from lookup</title>
<updated>2018-12-06T13:26:16Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-06T13:19:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eff3860bbfedbac6edac57fb0d7f3a60e860c1c3'/>
<id>urn:sha1:eff3860bbfedbac6edac57fb0d7f3a60e860c1c3</id>
<content type='text'>
Commit 66ee620f06f9 ("idr: Permit any valid kernel pointer to be stored")
changed the radix tree lookup so that it stops when reaching the bottom
of the tree.  However, the condition was added in the wrong place,
making it possible to return retry entries to the caller.  Reorder the
tests to check for the retry entry before checking whether we're at the
bottom of the tree.  The retry entry should never be found in the tree
root, so it's safe to defer the check until the end of the loop.

Add a regression test to the test-suite to be sure this doesn't come
back.

Fixes: 66ee620f06f9 ("idr: Permit any valid kernel pointer to be stored")
Reported-by: Greg Kurz &lt;groug@kaod.org&gt;
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree: Remove multiorder support</title>
<updated>2018-10-21T14:46:48Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-22T20:14:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3a08cd52c37c793ffc199f6fc2ecfc368e284b2d'/>
<id>urn:sha1:3a08cd52c37c793ffc199f6fc2ecfc368e284b2d</id>
<content type='text'>
All users have now been converted to the XArray.  Removing the support
reduces code size and ensures new users will use the XArray instead.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree test: Convert multiorder tests to XArray</title>
<updated>2018-10-21T14:46:48Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-22T20:12:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=542980aa9318edcfb68aa7bf6eacf2814dc137dd'/>
<id>urn:sha1:542980aa9318edcfb68aa7bf6eacf2814dc137dd</id>
<content type='text'>
This is the last remaining user of the multiorder functionality of the
radix tree.  Test the XArray instead.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree tests: Convert item_delete_rcu to XArray</title>
<updated>2018-10-21T14:46:48Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-22T19:34:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b66b5a48b8a0e43dc114573da11c1a9c586a2d4f'/>
<id>urn:sha1:b66b5a48b8a0e43dc114573da11c1a9c586a2d4f</id>
<content type='text'>
In preparation for the removal of the multiorder radix tree code,
convert item_delete_rcu() to use the XArray so it can still be called
for XArrays containing multi-index entries.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree tests: Convert item_kill_tree to XArray</title>
<updated>2018-10-21T14:46:47Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-13T14:15:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ccc89e30fac790e3a175dbfc863c67286fce96b0'/>
<id>urn:sha1:ccc89e30fac790e3a175dbfc863c67286fce96b0</id>
<content type='text'>
In preparation for the removal of the multiorder radix tree code,
convert item_kill_tree() to use the XArray so it can still be called
for XArrays containing multi-index entries.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree tests: Move item_insert_order</title>
<updated>2018-10-21T14:46:47Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-13T03:29:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4bb53bdda0d1e061035774ed4868bdeb4d889044'/>
<id>urn:sha1:4bb53bdda0d1e061035774ed4868bdeb4d889044</id>
<content type='text'>
The remaining tests are not suitable for moving in-kernel, so move
item_insert_order() into multiorder.c, make it static and make it use
the XArray.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree test suite: Remove multiorder benchmarking</title>
<updated>2018-10-21T14:46:47Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-13T03:12:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=879a9ae7b5bc046f195a725d62bbc96258e5d0c8'/>
<id>urn:sha1:879a9ae7b5bc046f195a725d62bbc96258e5d0c8</id>
<content type='text'>
The multiorder radix tree code is being removed, so remove the
benchmarking of its performance.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>radix tree test suite: Remove __item_insert</title>
<updated>2018-10-21T14:46:47Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-12T16:52:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9076b33d7dad8e316c90918845417e85347f682c'/>
<id>urn:sha1:9076b33d7dad8e316c90918845417e85347f682c</id>
<content type='text'>
Inline it into its one caller

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>xarray: Move multiorder_check to in-kernel tests</title>
<updated>2018-10-21T14:46:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-09T05:52:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4f06d6302da682157890f72c0573e12a73536814'/>
<id>urn:sha1:4f06d6302da682157890f72c0573e12a73536814</id>
<content type='text'>
This version is a little less thorough in order to be a little quicker,
but tests the important edge cases.  Also test adding a multiorder entry
at a non-canonical index, and erasing it.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
</feed>
