[Devel] [PATCH RH8 3/8] ve/kstat/alloc_lat: Initialize alloc_lat to zero at start

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Tue May 18 20:48:27 MSK 2021


From: Andrey Ryabinin <aryabinin at virtuozzo.com>

It seems that 'struct task_struct' not initialized to zero after
allocation. Thus we need to initialize alloc_lat explicitly.

https://jira.sw.ru/browse/PSBM-81395
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>

(cherry-picked from 82ddc4c43f2d97c5c0d009072e5b06acf3f3a241)
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 kernel/fork.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/fork.c b/kernel/fork.c
index c996de5..61175de 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -919,6 +919,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
 	if (orig->cpus_ptr == &orig->cpus_mask)
 		tsk->cpus_ptr = &tsk->cpus_mask;
 
+#ifdef CONFIG_VE
+	memset(tsk->alloc_lat, 0, sizeof(tsk->alloc_lat));
+#endif
+
 	/*
 	 * One for the user space visible state that goes away when reaped.
 	 * One for the scheduler.
-- 
1.8.3.1



More information about the Devel mailing list