mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
7ad3d4d85c
When we preload the IDA, we allocate an IDA bitmap. Instead of storing that preallocated bitmap in the IDA, we store it in a percpu variable. Generally there are more IDAs in the system than CPUs, so this cuts down on the number of preallocated bitmaps that are unused, and about half of the IDA users did not call ida_destroy() so they were leaking IDA bitmaps. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
11 lines
428 B
C
11 lines
428 B
C
#define DECLARE_PER_CPU(type, val) extern type val
|
|
#define DEFINE_PER_CPU(type, val) type val
|
|
|
|
#define __get_cpu_var(var) var
|
|
#define this_cpu_ptr(var) var
|
|
#define this_cpu_read(var) var
|
|
#define this_cpu_xchg(var, val) uatomic_xchg(&var, val)
|
|
#define this_cpu_cmpxchg(var, old, new) uatomic_cmpxchg(&var, old, new)
|
|
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
|
|
#define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu))
|