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

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 24 20:12:57 MSK 2021


Merged into previous patch.

f221a0258c4a ve/page_alloc, kstat: account allocation latencies per-task and per-thread

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 05/18/2021 08:48 PM, Andrey Zhadchenko wrote:
> 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.
>


More information about the Devel mailing list