[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230729135334.566138-3-atomlin@atomlin.com>
Date: Sat, 29 Jul 2023 14:53:34 +0100
From: Aaron Tomlin <atomlin@...mlin.com>
To: linux-kernel@...r.kernel.org
Cc: tj@...nel.org, jiangshanlai@...il.com, peterz@...radead.org
Subject: [RFC PATCH 2/2] workqueue: Simplify current_is_workqueue_rescuer()
No functional change.
This patch simplifies current_is_workqueue_rescuer()
due to the addition of PF_WQ_RESCUE_WORKER.
Signed-off-by: Aaron Tomlin <atomlin@...mlin.com>
---
kernel/workqueue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6d38d714b72b..3b7a4d60cb6a 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4890,9 +4890,9 @@ EXPORT_SYMBOL(current_work);
*/
bool current_is_workqueue_rescuer(void)
{
- struct worker *worker = current_wq_worker();
-
- return worker && worker->rescue_wq;
+ if (in_task() && (current->flags & PF_WQ_RESCUE_WORKER))
+ return true;
+ return false;
}
/**
--
2.39.1
Powered by blists - more mailing lists