From: Peter Zijlstra <peterz@infradead.org>
To: brookxu <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: Mon, 9 Oct 2023 16:17:04 +0200 [thread overview]
Message-ID: <20231009141704.GE14330@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <a93f13de-a018-2ee4-c7a0-855c3bd04444@gmail.com>
On Mon, Oct 09, 2023 at 06:29:15PM +0800, brookxu wrote:
>
> 在 2023/10/9 16:43, Peter Zijlstra 写道:
> > On Sun, Oct 08, 2023 at 07:10:01PM +0800, brookxu wrote:
> >
> > > > > @@ -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.
> > But it's 80 bytes 'nobody' will use. And arguably we should do the same
> > with schedstats, that's default disabled and again, that's per-task
> > storage nobody ever uses.
> >
> > Per this argument we can grow task_struct indefinitely until it
> > collapses in on itself by the sheer weight of it's information density.
> > Every additional field will be a smaller fraction of the total.
> >
> > Yes, it makes it all a little more cumbersome, but we should really not
> > burden everybody with the load of some.
> >
> > Surely there is another solution... ?
> Thanks, agree with you, I try do it in other ways :)
One option is to first flip the static key and then iterate all existing
tasks, allocating the memory structure. New tasks will get it allocated
per the static key, existing tasks will get it allocated per the
iteration and dying tasks we don't care about.
That would be sufficient, no?
next prev parent reply other threads:[~2023-10-09 14:17 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
2023-10-09 8:43 ` Peter Zijlstra
2023-10-09 10:29 ` brookxu
2023-10-09 14:17 ` Peter Zijlstra [this message]
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=20231009141704.GE14330@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