Skip to content
Snippets Groups Projects
Commit 5a60e13d authored by Glauber Costa's avatar Glauber Costa Committed by Pekka Enberg
Browse files

reclaim: export address of the OSV reclaimer


ZFS will perform some checks to determine if the current calling "process"
is the reclaimer. Export the address of the reclaimer thread so that test
can work.

Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 36c0cebc
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,9 @@ __END_DECLS
#define curproc (get_curproc())
extern unsigned char *osv_reclaimer_thread;
#define pageproc ((struct proc *)osv_reclaimer_thread)
#endif
#endif
......@@ -40,6 +40,7 @@ TRACEPOINT(trace_memory_huge_failure, "page ranges=%d", unsigned long);
TRACEPOINT(trace_memory_reclaim, "shrinker %s, target=%d, delta=%d", const char *, long, long);
bool smp_allocator = false;
unsigned char *osv_reclaimer_thread;
namespace memory {
......@@ -615,6 +616,7 @@ reclaimer::reclaimer()
// std::thread is implemented ontop of pthreads, so it is fine
std::thread tmp([&] {
_thread = sched::thread::current();
osv_reclaimer_thread = reinterpret_cast<unsigned char *>(_thread);
allow_emergency_alloc = true;
do {
_do_reclaim();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment