public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Chuyi Zhou <zhouchuyi@bytedance.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, vschneid@redhat.com
Cc: chengming.zhou@linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] sched/fair: Sync se's load_avg with cfs_rq in reweight_task
Date: Mon, 29 Jul 2024 09:56:35 +0200	[thread overview]
Message-ID: <01e68be1-dc49-448c-9338-70ececd0bec7@arm.com> (raw)
In-Reply-To: <20240723114247.104848-1-zhouchuyi@bytedance.com>

On 23/07/2024 13:42, Chuyi Zhou wrote:
> In reweight_task(), there are two situations:
> 
> 1. The task was on_rq, then the task's load_avg is accurate because we
> synchronized it with cfs_rq through update_load_avg() in dequeue_task().

Just asking: That's the dequeue_task() in __sched_setscheduler() or
set_user_nice()? Maybe this is worth mentioning here?

[...]

> @@ -3795,7 +3816,9 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
>  		if (!curr)
>  			__dequeue_entity(cfs_rq, se);
>  		update_load_sub(&cfs_rq->load, se->load.weight);
> -	}
> +	} else if (entity_is_task(se))
> +		sync_entity_load_avg(se);
> +

IMHO, the 'if else' path needs braces. See
Documentation/process/coding-style.rst '3) Placing Braces and Spaces'.

>  	dequeue_load_avg(cfs_rq, se);
>  
>  	if (se->on_rq) {

[...]

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

  parent reply	other threads:[~2024-07-29  7:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 11:42 [PATCH v3] sched/fair: Sync se's load_avg with cfs_rq in reweight_task Chuyi Zhou
2024-07-23 15:48 ` Vishal Chourasia
2024-07-23 21:10   ` Dietmar Eggemann
2024-07-23 23:00     ` Vishal Chourasia
2024-07-24  2:12       ` Chengming Zhou
2024-07-24  9:06         ` Dietmar Eggemann
2024-07-24  2:08 ` Chengming Zhou
2024-07-24  6:20 ` Vishal Chourasia
2024-07-29  7:56 ` Dietmar Eggemann [this message]
2024-07-29  8:20   ` Chuyi Zhou

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=01e68be1-dc49-448c-9338-70ececd0bec7@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=bsegall@google.com \
    --cc=chengming.zhou@linux.dev \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=zhouchuyi@bytedance.com \
    /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