public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "brookxu.cn" <brookxu.cn@gmail.com>
Cc: bsingharora@gmail.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] delayacct: convert task->delays to a object
Date: Sun, 8 Oct 2023 12:58:01 +0200	[thread overview]
Message-ID: <20231008105801.GC6320@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <531ddc82793a39f4c09316d701a4b1170bcad4ab.1696761522.git.chunguang.xu@shopee.com>

On Sun, Oct 08, 2023 at 06:49:37PM +0800, brookxu.cn wrote:
> From: Chunguang Xu <chunguang.xu@shopee.com>
> 
> Since in some scenarios we still want to get the task delayacct
> through taskstats, so commit <0cd7c741f01de> introduces a sysctl to

This is not the canonical way to reference a commit.

> enable it dynamically. However, since task->delays is allocated
> during fork(), task->delays will not be reallocated when delayacct
> is enabled later. This will make we cannot get the delayacct of old
> tasks, but the new tasks cans. This can easily lead to confusion.
> Therefore, try to workaround this issue by convert task->delays to
> an object.

And grow task_struct for no reason? I think not.

> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 77f01ac385f7..5cc78184a31f 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -37,6 +37,7 @@
>  #include <linux/kcsan.h>
>  #include <linux/rv.h>
>  #include <linux/livepatch_sched.h>
> +#include <linux/delayacct.h>
>  #include <asm/kmap_size.h>
>  
>  /* task_struct member predeclarations (sorted alphabetically): */
> @@ -1331,7 +1332,7 @@ struct task_struct {
>  	struct page_frag		task_frag;
>  
>  #ifdef CONFIG_TASK_DELAY_ACCT
> -	struct task_delay_info		*delays;
> +	struct task_delay_info		delays;
>  #endif

Yeah, no.

  reply	other threads:[~2023-10-08 10:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 10:49 [PATCH 0/3] delayacct: optimization & code simplify brookxu.cn
2023-10-08 10:49 ` [PATCH 1/3] delayacct: introduce delayacct_enabled() to simplify implement brookxu.cn
2023-10-08 10:56   ` Peter Zijlstra
2023-10-08 11:03     ` brookxu
2023-10-08 10:49 ` [PATCH 2/3] delayacct: convert task->delays to a object brookxu.cn
2023-10-08 10:58   ` Peter Zijlstra [this message]
2023-10-08 11:10     ` brookxu
2023-10-09  8:43       ` Peter Zijlstra
2023-10-09 10:29         ` brookxu
2023-10-09 14:17           ` Peter Zijlstra
2023-10-09 11:38         ` brookxu
2023-10-09 14:18           ` Peter Zijlstra
2023-10-08 13:42   ` kernel test robot
2023-10-08 15:47   ` kernel test robot
2023-10-08 16:18   ` kernel test robot
2023-10-08 10:49 ` [PATCH 3/3] delayacct: remove delayacct_on to simplify the code brookxu.cn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231008105801.GC6320@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=brookxu.cn@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox