<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/test_xarray.c, branch v5.0</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.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-01-14T19:50:34Z</updated>
<entry>
<title>XArray tests: Check mark 2 gets squashed</title>
<updated>2019-01-14T19:50:34Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2019-01-14T18:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d69d287a9002b70bdbe2975660b97241ccefc071'/>
<id>urn:sha1:d69d287a9002b70bdbe2975660b97241ccefc071</id>
<content type='text'>
We do not currently check that the loop in xas_squash_marks() doesn't have
an off-by-one error in it.  It didn't, but a patch which introduced an
off-by-one error wasn't caught by any existing test.  Switch the roles
of XA_MARK_1 and XA_MARK_2 to catch that bug.

Reported-by: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Honour reserved entries in xa_insert</title>
<updated>2019-01-07T03:12:58Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2019-01-02T18:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0606fed6eece16a421034eca0bbea9a08b90e91'/>
<id>urn:sha1:b0606fed6eece16a421034eca0bbea9a08b90e91</id>
<content type='text'>
xa_insert() should treat reserved entries as occupied, not as available.
Also, it should treat requests to insert a NULL pointer as a request
to reserve the slot.  Add xa_insert_bh() and xa_insert_irq() for
completeness.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Permit storing 2-byte-aligned pointers</title>
<updated>2019-01-07T03:12:57Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-29T04:20:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76b4e52995654af260f14558e0e07b5b039ae202'/>
<id>urn:sha1:76b4e52995654af260f14558e0e07b5b039ae202</id>
<content type='text'>
On m68k, statically allocated pointers may only be two-byte aligned.
This clashes with the XArray's method for tagging internal pointers.
Permit storing these pointers in single slots (ie not in multislots).

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Change xa_for_each iterator</title>
<updated>2019-01-07T02:24:43Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-17T19:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4a31896c5b5a2715ecf4033426aa0a35066d92d6'/>
<id>urn:sha1:4a31896c5b5a2715ecf4033426aa0a35066d92d6</id>
<content type='text'>
There were three problems with this API:
1. It took too many arguments; almost all users wanted to iterate over
every element in the array rather than a subset.
2. It required that 'index' be initialised before use, and there's no
realistic way to make GCC catch that.
3. 'index' and 'entry' were the opposite way round from every other
member of the XArray APIs.

So split it into three different APIs:

xa_for_each(xa, index, entry)
xa_for_each_start(xa, index, entry, start)
xa_for_each_marked(xa, index, entry, filter)

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Add RCU locking</title>
<updated>2019-01-07T02:24:43Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-17T22:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=490fd30f859572ac97a51faa31860869744ba97b'/>
<id>urn:sha1:490fd30f859572ac97a51faa31860869744ba97b</id>
<content type='text'>
0day picked up that I'd forgotten to add locking to this new test.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix xa_alloc when id exceeds max</title>
<updated>2018-12-13T19:07:33Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-13T18:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48483614de97c4f5219abeda630e62b2bebdce62'/>
<id>urn:sha1:48483614de97c4f5219abeda630e62b2bebdce62</id>
<content type='text'>
Specifying a starting ID greater than the maximum ID isn't something
attempted very often, but it should fail.  It was succeeding due to
xas_find_marked() returning the wrong error state, so add tests for
both xa_alloc() and xas_find_marked().

Fixes: b803b42823d0 ("xarray: Add XArray iterators")
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Check iterating over multiorder entries</title>
<updated>2018-12-06T14:25:33Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-29T21:04:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f145cd66a1a76136ff5a03a99e37ba082715dc6'/>
<id>urn:sha1:4f145cd66a1a76136ff5a03a99e37ba082715dc6</id>
<content type='text'>
There was no bug here, but there was no test coverage for this scenario.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Handle larger indices more elegantly</title>
<updated>2018-12-06T14:25:15Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T18:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b7677a132a4c2ff877986c5b30f9427127b9897a'/>
<id>urn:sha1:b7677a132a4c2ff877986c5b30f9427127b9897a</id>
<content type='text'>
xa_mk_value() only handles values up to LONG_MAX.  I successfully hid
that inside xa_store_index() and xa_erase_index(), but it turned out I
also needed it for testing xa_alloc() on 32-bit machines.  So extract
xa_mk_index() from the above two functions, and convert the non-constant
users of xa_mk_value() to xa_mk_index().

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Add missing locking</title>
<updated>2018-11-19T14:41:11Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-19T14:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fffc9a260e38acec3187515738122a3ecb24ac90'/>
<id>urn:sha1:fffc9a260e38acec3187515738122a3ecb24ac90</id>
<content type='text'>
Lockdep caught me being sloppy in the test suite and failing to lock
the XArray appropriately.

Reported-by: kernel test robot &lt;rong.a.chen@intel.com&gt;
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Correct some 64-bit assumptions</title>
<updated>2018-11-16T21:38:45Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T14:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5404a7f1c21cfda061712bedf2d06cc0f6c755e9'/>
<id>urn:sha1:5404a7f1c21cfda061712bedf2d06cc0f6c755e9</id>
<content type='text'>
The test-suite caught these two mistakes when compiled for 32-bit.
I had only been running the test-suite in 64-bit mode.

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