firmware: stratix10-svc: stop kernel thread once service is completed
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 firmware: stratix10-svc: stop kernel thread once service is completed
This patch resolves a customer-reported issue where the Stratix10 SVC service layer caused maximum CPU utilization. The original logic only stopped the thread if it was running and there was one or fewer active clients. This overly restrictive condition prevented the thread from stopping even when the application was active, leading to unnecessary CPU consumption.
The updated logic now stops the thread whenever it is running, regardless of the number of active clients, ensuring better resource management and resolving the performance issue.
--- drivers/firmware/stratix10-svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/stratix10-svc.c +2 -2
@@ -1040,8 +1040,8 @@ EXPORT_SYMBOL_GPL(stratix10_svc_send);*/ void stratix10_svc_done (struct stratix10_svc_chan *chan) { -/* stop thread when thread is running AND only one active client */ -if (chan->ctrl->task && chan->ctrl->num_active_client <=1 ) { +/* stop thread when thread is running */ +if (chan->ctrl->task) {pr_debug ("svc_smc_hvc_shm_thread is stopped\n" );kthread_stop (chan->ctrl->task); chan->ctrl->task =NULL ;
Signature · 1 line
2.43.7
Quoted 24 lines · Khairul Anuar Romli
This patch resolves a customer-reported issue where the Stratix10 SVC service layer caused maximum CPU utilization. The original logic only stopped the thread if it was running and there was one or fewer active clients. This overly restrictive condition prevented the thread from stopping even when the application was active, leading to unnecessary CPU consumption.
The updated logic now stops the thread whenever it is running, regardless of the number of active clients, ensuring better resource management and resolving the performance issue.
Fixes 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")Cc [email protected] # 5.4+Signed-off-by Richard Gong <[email protected]>Signed-off-by Khairul Anuar Romli <[email protected]>--- drivers/firmware/stratix10-svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/stratix10-svc.c +0
-0
drivers/firmware/stratix10-svc.c EXPORT_SYMBOL_GPL(stratix10_svc_send); · line 1047
Quoted 10 lines
drivers/firmware/stratix10-svc.c +2
-2@@ -1040,8 +1040,8 @@ EXPORT_SYMBOL_GPL(stratix10_svc_send);*/ void stratix10_svc_done (struct stratix10_svc_chan *chan) { -/* stop thread when thread is running AND only one active client */ -if (chan->ctrl->task && chan->ctrl->num_active_client <=1 ) { +/* stop thread when thread is running */ +if (chan->ctrl->task) {pr_debug ("svc_smc_hvc_shm_thread is stopped\n" );kthread_stop (chan->ctrl->task); chan->ctrl->task =NULL ;
Applied!
Thanks,
Dinh
Quoted 42 lines · Dinh Nguyen
Quoted 26 lines · Khairul Anuar Romli
This patch resolves a customer-reported issue where the Stratix10 SVC service layer caused maximum CPU utilization. The original logic only stopped the thread if it was running and there was one or fewer active clients. This overly restrictive condition prevented the thread from stopping even when the application was active, leading to unnecessary CPU consumption.
The updated logic now stops the thread whenever it is running, regardless of the number of active clients, ensuring better resource management and resolving the performance issue.
Fixes 7ca5ce896524 ("firmware: add Intel Stratix10 service layerdriver")
Cc [email protected] # 5.4+Signed-off-by Richard Gong <[email protected]>Signed-off-by Khairul Anuar Romli <[email protected]>---
drivers/firmware/stratix10-svc.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/firmware/ renamed from drivers/firmware/stratix10-svc.c +0
-0
stratix10-svc.c
indexe3f990d888d7..ec39522711ea100644drivers/firmware/stratix10-svc.c EXPORT_SYMBOL_GPL(stratix10_svc_send); · line 1047
Quoted 10 lines
drivers/firmware/stratix10-svc.c +2
-2@@ -1040,8 +1040,8 @@ EXPORT_SYMBOL_GPL(stratix10_svc_send);*/ void stratix10_svc_done(struct stratix10_svc_chan *chan) { - /* stop thread when thread is running AND only one active client */ - if (chan->ctrl->task && chan->ctrl->num_active_client <= 1) { + /* stop thread when thread is running */ + if (chan->ctrl->task) { pr_debug("svc_smc_hvc_shm_thread is stopped\n"); kthread_stop(chan->ctrl->task); chan->ctrl->task = NULL;Applied!
Quoted 3 lines
Thanks,
Dinh
Cool. Thanks Dinh.
Best Regards,
Khairul