]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools: Add testing support for changes to rcu and slab for sheaves
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 14 Feb 2025 16:27:44 +0000 (17:27 +0100)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 3 Mar 2025 18:43:51 +0000 (13:43 -0500)
commitc0b6f4c488d8ec784035d06d13475974f482e3d9
treeb2bb6384e29bc7db407ba924b00e9f92805aeb02
parentf6033f6b83e33a88b073539ffc22012c8e48bc06
tools: Add testing support for changes to rcu and slab for sheaves

Make testing work for the slab and rcu changes that have come in with
the sheaves work.

This only works with one kmem_cache, and only the first one used.
Subsequent setting of keme_cache will not update the active kmem_cache
and will be silently dropped because there are other tests which happen
after the kmem_cache of interest is set.

The saved active kmem_cache is used in the rcu callback, which passes
the object to be freed.

The rcu call takes the rcu_head, which is passed in as the field in the
struct (in this case rcu in the maple tree node), which is calculated by
pointer math.  The offset of which is saved (in a global variable) for
restoring the node pointer on the callback after the rcu grace period
expires.

Don't use any of this outside of testing, please.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
tools/include/linux/slab.h
tools/testing/shared/linux.c
tools/testing/shared/linux/rcupdate.h