linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
	Yafang Shao <laoar.shao@gmail.com>, Mel Gorman <mgorman@suse.de>,
	x86@kernel.org
Subject: Re: [tip: sched/core] sched: Make struct sched_statistics independent of fair sched class
Date: Tue, 21 Sep 2021 09:17:07 +0200	[thread overview]
Message-ID: <YUmG8+96zgScrfqm@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210921061727.GA24828@kili>

On Tue, Sep 21, 2021 at 09:17:27AM +0300, Dan Carpenter wrote:
> On Thu, Sep 16, 2021 at 11:59:30AM -0000, tip-bot2 for Yafang Shao wrote:
> > @@ -11424,7 +11441,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
> >  		if (!cfs_rq)
> >  			goto err;
> >  
> > -		se = kzalloc_node(sizeof(struct sched_entity),
> > +		se = kzalloc_node(sizeof(struct sched_entity_stats),
> 
> This wasn't there in the original patch and it causes a Smatch warning

What original patch? It's part of the v4 posting.

> because "se" is declared as a "sched_entity" but it's allocating a
> larger "sched_entity_stats" which contains a sched_entity.

Yep, on purpose.

> To me, ideally, we would update the type of se.

That's a lot of churn for very little gain. I can rewrite it like:

	struct sched_entity_stats *ses = kzalloc_node(sizeof(*ses),...);
	se = &ses->se;

If that makes smatch happy. It's the exact same thing tho because we
force ses->se to be at 0 offset.

  reply	other threads:[~2021-09-21  7:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05 14:35 [PATCH v4 0/8] sched: support schedstats for RT sched class Yafang Shao
2021-09-05 14:35 ` [PATCH v4 1/8] sched, fair: use __schedstat_set() in set_next_entity() Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched/fair: Use " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 2/8] sched: make struct sched_statistics independent of fair sched class Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched: Make " tip-bot2 for Yafang Shao
2021-09-21  6:17     ` Dan Carpenter
2021-09-21  7:17       ` Peter Zijlstra [this message]
2021-09-21  7:40         ` Dan Carpenter
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 3/8] sched: make schedstats helpers " Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched: Make " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 4/8] sched: introduce task block time in schedstats Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched: Introduce " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 5/8] sched, rt: support sched_stat_runtime tracepoint for RT sched class Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched/rt: Support " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 6/8] sched, rt: support schedstats " Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched/rt: Support " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 7/8] sched, dl: support sched_stat_runtime tracepoint for deadline " Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched/dl: Support " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-05 14:35 ` [PATCH v4 8/8] sched, dl: support schedstats " Yafang Shao
2021-09-16 11:59   ` [tip: sched/core] sched/dl: Support " tip-bot2 for Yafang Shao
2021-10-05 14:12   ` tip-bot2 for Yafang Shao
2021-09-10 17:00 ` [PATCH v4 0/8] sched: support schedstats for RT " Peter Zijlstra

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=YUmG8+96zgScrfqm@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).