From: brookxu <brookxu.cn@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
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 19:10:01 +0800 [thread overview]
Message-ID: <5dba07eb-88f0-bf84-494e-b979f32ad44d@gmail.com> (raw)
In-Reply-To: <20231008105801.GC6320@noisy.programming.kicks-ass.net>
在 2023/10/8 18:58, Peter Zijlstra 写道:
> 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.
Yes, this way will increase about 80 bytes for task_struct, about 0.85%
of size of task_struct, I think this just like sched_statistics, so that
can better support dynamically enable through sysctl.
next prev parent reply other threads:[~2023-10-08 11:10 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
2023-10-08 11:10 ` brookxu [this message]
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=5dba07eb-88f0-bf84-494e-b979f32ad44d@gmail.com \
--to=brookxu.cn@gmail.com \
--cc=bsingharora@gmail.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.