[rh7,v2,1/2] ve/kstat/alloc_lat: Initialize alloc_lat to zero at start

Submitted by Andrey Ryabinin on Feb. 19, 2018, 3:16 p.m.

Details

Message ID 20180219151615.4367-1-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Feb. 19, 2018, 3:16 p.m.
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@virtuozzo.com>
---
 kernel/fork.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/kernel/fork.c b/kernel/fork.c
index 645b489e33e0..112bef1e2695 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -373,6 +373,10 @@  static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
 	tsk->stack_canary = get_random_int();
 #endif
 
+#ifdef CONFIG_VE
+	memset(tsk->alloc_lat, 0, sizeof(tsk->alloc_lat));
+#endif
+
 	/*
 	 * One for us, one for whoever does the "release_task()" (usually
 	 * parent)