From a73f5f86dcb05ec98d66f70966f02624f2e2c9f3 Mon Sep 17 00:00:00 2001 From: fangxinyong Date: Fri, 8 Sep 2023 12:36:19 +0800 Subject: [PATCH] sched: do not crash for priority multi-boost aio client will queue asynchronous io requests to the worker threads. if PRIORITY_INHERITANCE is enabled, client thread's priority will be set to worker threads. There will be multi-boost/restore of worker threads' priority and assert the system. No need priority multi-boot/restore to worker thread because client thread's priority is alway the same. Signed-off-by: fangxinyong --- sched/wqueue/kwork_inherit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sched/wqueue/kwork_inherit.c b/sched/wqueue/kwork_inherit.c index a54fb790a1..05fdc59845 100644 --- a/sched/wqueue/kwork_inherit.c +++ b/sched/wqueue/kwork_inherit.c @@ -68,7 +68,10 @@ static void lpwork_boostworker(pid_t wpid, uint8_t reqprio) /* REVISIT: Priority multi-boost is not supported */ - DEBUGASSERT(wtcb->boost_priority == 0); + if (wtcb->boost_priority != 0) + { + return; + } /* If the priority of the client thread that is greater than the base * priority of the worker thread, then we may need to adjust the worker @@ -131,7 +134,10 @@ static void lpwork_restoreworker(pid_t wpid, uint8_t reqprio) /* REVISIT: Priority multi-boost is not supported. */ - DEBUGASSERT(wtcb->boost_priority == reqprio); + if (wtcb->boost_priority != reqprio) + { + return; + } /* Clear the threat boost priority. */