summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Qiuwen <[email protected]>2023-09-05 17:59:31 +0800
committerLu Qiuwen <[email protected]>2023-09-05 17:59:31 +0800
commitf09f8a66a5ecfc22c23802eb3e3441f17c704f36 (patch)
tree0175fa3801ec7cbc10869ebf0e176b9928874f61
parent42a34334ebe495254b43a4e532bb3d9292e2ed42 (diff)
修正io线程死锁检测不工作的问题。v4.6.50-20230905
-rw-r--r--app/src/marsio.c21
-rw-r--r--service/src/core.c28
-rw-r--r--service/src/node.c2
3 files changed, 19 insertions, 32 deletions
diff --git a/app/src/marsio.c b/app/src/marsio.c
index 0ea11fe..72b48cf 100644
--- a/app/src/marsio.c
+++ b/app/src/marsio.c
@@ -564,10 +564,9 @@ static void mp_cache_init_for_each_mp(struct rte_mempool * mp, void * arg)
}
}
-static int mpapp_mp_cache_init(struct mr_instance * instance)
+static void mpapp_mp_cache_init(struct mr_instance * instance)
{
rte_mempool_walk(mp_cache_init_for_each_mp, (void *)instance);
- return 0;
}
/* 注册应用 */
@@ -685,17 +684,6 @@ static int __ctrlplane_conn_close_handler(struct ctrlmsg_handler * ct_hand, stru
exit(EXIT_FAILURE);
}
-static void __open_device_unposion(struct vdev_instance * vdi)
-{
- MR_ASAN_UNPOISON_MEMORY_REGION(vdi, sizeof(struct vdev_instance));
- MR_ASAN_UNPOISON_MEMORY_REGION(vdi->vdev, sizeof(struct vdev));
-
- vnode_mirror_unpoison_cons(vdi->vnode_rx_cons);
- vnode_mirror_unpoison_prod(vdi->vnode_tx_prod);
- vnode_mirror_unpoison_prod(vdi->vnode_ftx_prod);
- vnode_mirror_unpoison_prod(vdi->vnode_ltx_prod);
-}
-
#if 0
static int __open_device_response_handler(struct ctrlmsg_handler * ct_hand,
struct ctrlmsg_conn * ct_conn, struct ctrl_msg_header * msg, void * arg)
@@ -1038,12 +1026,7 @@ int marsio_init(struct mr_instance * instance, const char * appsym)
}
/* local mp cache */
- if (mpapp_mp_cache_init(instance) != RT_SUCCESS)
- {
- MR_ERROR("Local mempool cache initialization failed.");
- goto err;
- }
-
+ mpapp_mp_cache_init(instance);
pthread_t pid_ctrlplane_thread;
int ret = pthread_create(&pid_ctrlplane_thread, NULL, mrapp_ctrlplane_thread, instance);
if (ret < 0)
diff --git a/service/src/core.c b/service/src/core.c
index 3b1ecae..dc6318e 100644
--- a/service/src/core.c
+++ b/service/src/core.c
@@ -191,9 +191,10 @@ int sc_check_spinlock_loop(struct sc_main * sc_main)
void sc_keepalive_failure_handler(void * data, const int id_core)
{
- MR_ERROR("Thread %d is dead, MRZCPD service exit. \n", id_core);
- exit(EXIT_FAILURE);
- return;
+ MR_ERROR("Thread %d is dead, exit. \n", id_core);
+
+ /* print the stack trace */
+ abort();
}
int sc_check_memleak_loop(struct sc_main * sc_main)
@@ -1228,25 +1229,26 @@ int main(int argc, char * argv[])
if (sc->en_spinlock_check)
{
sc->keepalive = rte_keepalive_create(sc_keepalive_failure_handler, sc);
+ if (sc->keepalive == NULL)
+ {
+ MR_ERROR("Create spinlock checker handler failed. ");
+ ret = EXIT_FAILURE;
+ goto quit;
+ }
}
- if (sc->en_spinlock_check && sc->keepalive == NULL)
- {
- MR_ERROR("Create spinlock checker handler failed. ");
- ret = EXIT_FAILURE;
- goto quit;
- }
-
- http_serv_init(sc);
-
unsigned int lcore_id_iter = 0;
RTE_LCORE_FOREACH(lcore_id_iter)
{
if (sc->keepalive)
+ {
rte_keepalive_register_core(sc->keepalive, (int)lcore_id_iter);
- MR_INFO("Keepalive register for thread %d successfully.", lcore_id_iter);
+ MR_INFO("Keepalive register for thread %d successfully.", lcore_id_iter);
+ }
}
+ http_serv_init(sc);
+
/* 恢复CPU亲和性设置为EAL后的线程绑定参数 */
ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &sc->cpu_set_after_eal);
MR_VERIFY_2(ret >= 0, "Cannot set init thread affinity: %s", strerror(errno));
diff --git a/service/src/node.c b/service/src/node.c
index dba70be..a38a1fa 100644
--- a/service/src/node.c
+++ b/service/src/node.c
@@ -168,6 +168,8 @@ int32_t node_manager_pkt_graph_service_entry(void * args)
rte_graph_walk(graph_object);
}
+ /* mark the lcore is alive */
+ rte_keepalive_mark_alive(sc->keepalive);
return 0;
}