From a49c9baffa46f467279a9139ec8fc4934d037f93 Mon Sep 17 00:00:00 2001 From: Amit Dhingra Date: Sat, 7 Oct 2023 16:32:26 +0200 Subject: [PATCH] Replace schedule_work with queue_work schedule_work adds work to global workqueue. In this example, we create a local workqueue. Use the local workqueue by calling queue_work(), instead of putting work on the global workqueue. --- examples/sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sched.c b/examples/sched.c index 1f2da0ea..7e2dbbe7 100644 --- a/examples/sched.c +++ b/examples/sched.c @@ -17,7 +17,7 @@ static int __init sched_init(void) { queue = alloc_workqueue("HELLOWORLD", WQ_UNBOUND, 1); INIT_WORK(&work, work_handler); - schedule_work(&work); + queue_work(queue, &work); return 0; }