mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuyi Zhou <zhouchuyi@bytedance.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.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 16:20:38 +0800	[thread overview]
Message-ID: <ce019e81-7758-4586-b54b-1d9e078f9ca4@bytedance.com> (raw)
In-Reply-To: <01e68be1-dc49-448c-9338-70ececd0bec7@arm.com>

Hello,

在 2024/7/29 15:56, Dietmar Eggemann 写道:
> 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?

OK.

> 
> [...]
> 
>> @@ -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'.

Thanks, will fix it in next version.

> 
>>   	dequeue_load_avg(cfs_rq, se);
>>   
>>   	if (se->on_rq) {
> 
> [...]
> 
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

      reply	other threads:[~2024-07-29  8:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 11:42 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
2024-07-29  8:20   ` Chuyi Zhou [this message]

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=ce019e81-7758-4586-b54b-1d9e078f9ca4@bytedance.com \
    --to=zhouchuyi@bytedance.com \
    --cc=bsegall@google.com \
    --cc=chengming.zhou@linux.dev \
    --cc=dietmar.eggemann@arm.com \
    --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 \
    /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

all inboxes | Powered by JetHome®