mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 10:30:54 +07:00
3159f943aa
Introduce xarray value entries and tagged pointers to replace radix tree exceptional entries. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in emphasis; exceptional entries are intimidating and different. As the comment explains, you can choose to store values or pointers in the xarray and they are both first-class citizens. Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Josef Bacik <jbacik@fb.com>
27 lines
657 B
C
27 lines
657 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TEST_RADIX_TREE_H
|
|
#define _TEST_RADIX_TREE_H
|
|
|
|
#include "../../../../include/linux/radix-tree.h"
|
|
|
|
extern int kmalloc_verbose;
|
|
extern int test_verbose;
|
|
|
|
static inline void trace_call_rcu(struct rcu_head *head,
|
|
void (*func)(struct rcu_head *head))
|
|
{
|
|
if (kmalloc_verbose)
|
|
printf("Delaying free of %p to slab\n", (char *)head -
|
|
offsetof(struct radix_tree_node, rcu_head));
|
|
call_rcu(head, func);
|
|
}
|
|
|
|
#define printv(verbosity_level, fmt, ...) \
|
|
if(test_verbose >= verbosity_level) \
|
|
printf(fmt, ##__VA_ARGS__)
|
|
|
|
#undef call_rcu
|
|
#define call_rcu(x, y) trace_call_rcu(x, y)
|
|
|
|
#endif /* _TEST_RADIX_TREE_H */
|