Skip to content
Snippets Groups Projects
Commit debeafb3 authored by Ali Mohammed's avatar Ali Mohammed
Browse files

update numa info of threads

parent 6e2fcf15
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "maestro/logging.h" #include "maestro/logging.h"
#include "maestro/i_globals.h" #include "maestro/i_globals.h"
#include "maestro/i_maestro_numa.h" #include "maestro/i_maestro_numa.h"
/* simplify logging */ /* simplify logging */
#define DEBUG(...) LOG_DEBUG(MSTRO_LOG_MODULE_ERL,__VA_ARGS__) #define DEBUG(...) LOG_DEBUG(MSTRO_LOG_MODULE_ERL,__VA_ARGS__)
#define INFO(...) LOG_INFO(MSTRO_LOG_MODULE_ERL,__VA_ARGS__) #define INFO(...) LOG_INFO(MSTRO_LOG_MODULE_ERL,__VA_ARGS__)
...@@ -45,6 +45,20 @@ ...@@ -45,6 +45,20 @@
#define ERR(...) LOG_ERR(MSTRO_LOG_MODULE_ERL,__VA_ARGS__) #define ERR(...) LOG_ERR(MSTRO_LOG_MODULE_ERL,__VA_ARGS__)
static inline
mstro_status
erl_thread_team_bind_and_update_numa(struct erl_thread_team_ctx *ctx)
{
mstro_status status = mstro_numa_bind_thread(ctx->tidprefix);
#ifdef HAVE_NUMA
/**update numa node*/
int numa_node = numa_node_of_cpu(mstro_numa_get_cpu(void));
ctx->numa_node = numa_node;
#endif
return status;
}
/** function that is run inside a thread to pick up and handle messages /** function that is run inside a thread to pick up and handle messages
* (in envelope) from the incoming queue */ * (in envelope) from the incoming queue */
...@@ -72,7 +86,7 @@ erl_thread_team_threadfun(void *closure) ...@@ -72,7 +86,7 @@ erl_thread_team_threadfun(void *closure)
DEBUG("%s handler thread %zu running\n", ctx->tidprefix, ctx->id); DEBUG("%s handler thread %zu running\n", ctx->tidprefix, ctx->id);
/*check thread pinning*/ /*check thread pinning*/
s = mstro_numa_bind_thread(ctx->tidprefix); s = erl_thread_team_bind_and_update_numa(ctx);
if(s != MSTRO_OK) if(s != MSTRO_OK)
{ {
WARN("Failed to pin the thread \n"); WARN("Failed to pin the thread \n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment