mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: Shang XiaoJing <shangxiaojing@huawei.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] sched/deadline: Save processing meaningless ops in dl_task_offline_migration
Date: Mon, 29 Aug 2022 10:33:50 +0200	[thread overview]
Message-ID: <3a623696-a0f9-2246-420d-aee88d6acd75@redhat.com> (raw)
In-Reply-To: <20220827020430.29415-1-shangxiaojing@huawei.com>

On 8/27/22 04:04, Shang XiaoJing wrote:
> Task's bw will be sub from old rd, and add to new rd, even though
> find_lock_later_rq returns a new rq that belong to the same rd with old
> rq. Save ops for moving task's bw if rd is not changed.

This subject is not good. Please change it to a "meaningful" one, describing the
change, not its consequence.

-- Daniel
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
>  kernel/sched/deadline.c | 28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 3bf4b12ec5b7..58ca9aaa9c44 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -714,20 +714,22 @@ static struct rq *dl_task_offline_migration(struct rq *rq, struct task_struct *p
>  		add_rq_bw(&p->dl, &later_rq->dl);
>  	}
>  
> -	/*
> -	 * And we finally need to fixup root_domain(s) bandwidth accounting,
> -	 * since p is still hanging out in the old (now moved to default) root
> -	 * domain.
> -	 */
> -	dl_b = &rq->rd->dl_bw;
> -	raw_spin_lock(&dl_b->lock);
> -	__dl_sub(dl_b, p->dl.dl_bw, cpumask_weight(rq->rd->span));
> -	raw_spin_unlock(&dl_b->lock);
> +	if (&rq->rd != &later_rq->rd) {
> +		/*
> +		 * And we finally need to fixup root_domain(s) bandwidth accounting,
> +		 * since p is still hanging out in the old (now moved to default) root
> +		 * domain.
> +		 */
> +		dl_b = &rq->rd->dl_bw;
> +		raw_spin_lock(&dl_b->lock);
> +		__dl_sub(dl_b, p->dl.dl_bw, cpumask_weight(rq->rd->span));
> +		raw_spin_unlock(&dl_b->lock);
>  
> -	dl_b = &later_rq->rd->dl_bw;
> -	raw_spin_lock(&dl_b->lock);
> -	__dl_add(dl_b, p->dl.dl_bw, cpumask_weight(later_rq->rd->span));
> -	raw_spin_unlock(&dl_b->lock);
> +		dl_b = &later_rq->rd->dl_bw;
> +		raw_spin_lock(&dl_b->lock);
> +		__dl_add(dl_b, p->dl.dl_bw, cpumask_weight(later_rq->rd->span));
> +		raw_spin_unlock(&dl_b->lock);
> +	}
>  
>  	set_task_cpu(p, later_rq->cpu);
>  	double_unlock_balance(later_rq, rq);


      reply	other threads:[~2022-08-29  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27  2:04 Shang XiaoJing
2022-08-29  8:33 ` Daniel Bristot de Oliveira [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=3a623696-a0f9-2246-420d-aee88d6acd75@redhat.com \
    --to=bristot@redhat.com \
    --cc=bsegall@google.com \
    --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=shangxiaojing@huawei.com \
    --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®