]> 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>
Mon, 2 Dec 2024 21:33:10 +0000 (16:33 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Apr 2025 20:01:05 +0000 (16:01 -0400)
commit9bff4fae81f4883e56af5f5c72bc1b9fe3883b6a
treed0099bf07f2e2e6ce0aef0fb22dba1c2830b747e
parent5fd2f244c49817a7ce245c980f1c25f0d966721c
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 kmem_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