[Devel] [PATCH vz8 1/2] ve, kthread: Remove some useless crud.

Andrey Ryabinin aryabinin at virtuozzo.com
Thu Oct 17 15:49:04 MSK 2019


Simplify the code by removing useless macroses.

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 include/linux/kthread.h | 16 ----------------
 kernel/ve/ve.c          |  7 +++++--
 net/sunrpc/svc.c        |  2 +-
 3 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 44fad78e7aa5..be56e19a78ec 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -59,22 +59,6 @@ struct task_struct *kthread_create_on_node_ve_flags(struct ve_struct *ve,
 						    void *data, int node,
 						    const char namefmt[],
 						    ...);
-
-#define kthread_create_on_node_ve(ve, arg...)				\
-	kthread_create_on_node_ve_flags(ve, 0, ##arg)
-
-#define kthread_create_ve(ve, threadfn, data, namefmt, arg...) \
-	kthread_create_on_node_ve(ve, threadfn, data, NUMA_NO_NODE, namefmt, ##arg)
-
-#define kthread_run_ve(ve, threadfn, data, namefmt, ...)		   \
-({									   \
-	struct task_struct *__k						   \
-		= kthread_create_ve(ve, threadfn, data, namefmt, ## __VA_ARGS__); \
-	if (!IS_ERR(__k))						   \
-		wake_up_process(__k);					   \
-	__k;								   \
-})
-
 #endif
 void free_kthread_struct(struct task_struct *k);
 void kthread_bind(struct task_struct *k, unsigned int cpu);
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index ab8283584e46..28b1d0748061 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -245,12 +245,15 @@ static int ve_start_umh(struct ve_struct *ve)
 	struct task_struct *task;
 
 	kthread_init_worker(&ve->umh_worker);
-	task = kthread_run_ve(ve, kthread_worker_fn,
-				      &ve->umh_worker,
+
+	task = kthread_create_on_node_ve_flags(ve, 0, kthread_worker_fn,
+				      &ve->umh_worker, NUMA_NO_NODE,
 				      "khelper");
 	if (IS_ERR(task))
 		return PTR_ERR(task);
 
+	wake_up_process(task);
+
 	ve->umh_task = task;
 	return 0;
 }
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 27a5289582ec..143b06f209f5 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -722,7 +722,7 @@ svc_start_kthreads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
 			return PTR_ERR(rqstp);
 
 		__module_get(serv->sv_ops->svo_module);
-		task = kthread_create_on_node_ve(get_exec_env(),
+		task = kthread_create_on_node_ve_flags(get_exec_env(), 0,
 						 serv->sv_ops->svo_function,
 						 rqstp, node,
 						 "%s", serv->sv_name);
-- 
2.21.0



More information about the Devel mailing list