* [PATCH v2] async: Using current_work() to implement current_is_async()
@ 2019-09-27 3:29 Yunfeng Ye
2019-10-26 10:56 ` Yunfeng Ye
0 siblings, 1 reply; 2+ messages in thread
From: Yunfeng Ye @ 2019-09-27 3:29 UTC (permalink / raw)
To: Bart Van Assche, Alexander Duyck, gregkh, bhelgaas, David Sterba,
tglx, sakari.ailus
Cc: linux-kernel
current_is_async() can be implemented using current_work(), it's better
not to be aware of the workqueue's internal information.
Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
v1 -> v2:
- add "Reviewed-by"
kernel/async.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/async.c b/kernel/async.c
index 1de270d..a849f98 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -53,8 +53,6 @@ asynchronous and synchronous parts of the kernel.
#include <linux/slab.h>
#include <linux/workqueue.h>
-#include "workqueue_internal.h"
-
static async_cookie_t next_cookie = 1;
#define MAX_WORK 32768
@@ -327,8 +325,8 @@ EXPORT_SYMBOL_GPL(async_synchronize_cookie);
*/
bool current_is_async(void)
{
- struct worker *worker = current_wq_worker();
+ struct work_struct *work = current_work();
- return worker && worker->current_func == async_run_entry_fn;
+ return work && work->func == async_run_entry_fn;
}
EXPORT_SYMBOL_GPL(current_is_async);
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2] async: Using current_work() to implement current_is_async()
2019-09-27 3:29 [PATCH v2] async: Using current_work() to implement current_is_async() Yunfeng Ye
@ 2019-10-26 10:56 ` Yunfeng Ye
0 siblings, 0 replies; 2+ messages in thread
From: Yunfeng Ye @ 2019-10-26 10:56 UTC (permalink / raw)
To: Bart Van Assche, Alexander Duyck, gregkh, bhelgaas, David Sterba,
tglx, sakari.ailus
Cc: linux-kernel, hushiyuan, linfeilong
current_is_async() can be implemented using current_work(), it's better
not to be aware of the workqueue's internal information.
Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
v1 -> v2:
- add "Reviewed-by"
kernel/async.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/async.c b/kernel/async.c
index 1de270d..a849f98 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -53,8 +53,6 @@ asynchronous and synchronous parts of the kernel.
#include <linux/slab.h>
#include <linux/workqueue.h>
-#include "workqueue_internal.h"
-
static async_cookie_t next_cookie = 1;
#define MAX_WORK 32768
@@ -327,8 +325,8 @@ EXPORT_SYMBOL_GPL(async_synchronize_cookie);
*/
bool current_is_async(void)
{
- struct worker *worker = current_wq_worker();
+ struct work_struct *work = current_work();
- return worker && worker->current_func == async_run_entry_fn;
+ return work && work->func == async_run_entry_fn;
}
EXPORT_SYMBOL_GPL(current_is_async);
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-26 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 3:29 [PATCH v2] async: Using current_work() to implement current_is_async() Yunfeng Ye
2019-10-26 10:56 ` Yunfeng Ye
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®