From: tip-bot for Dietmar Eggemann <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, luca.abeni@santannapisa.it,
valentin.schneider@arm.com, tglx@linutronix.de,
dietmar.eggemann@arm.com, qais.yousef@arm.com,
juri.lelli@redhat.com, bristot@redhat.com,
linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@kernel.org
Subject: [tip:sched/urgent] sched/deadline: Fix double accounting of rq/running bw in push & pull
Date: Tue, 6 Aug 2019 04:19:20 -0700 [thread overview]
Message-ID: <tip-f4904815f97a934258445a8f763f6b6c48f007e7@git.kernel.org> (raw)
In-Reply-To: <20190802145945.18702-2-dietmar.eggemann@arm.com>
Commit-ID: f4904815f97a934258445a8f763f6b6c48f007e7
Gitweb: https://git.kernel.org/tip/f4904815f97a934258445a8f763f6b6c48f007e7
Author: Dietmar Eggemann <dietmar.eggemann@arm.com>
AuthorDate: Fri, 2 Aug 2019 15:59:43 +0100
Committer: Peter Zijlstra <peterz@infradead.org>
CommitDate: Tue, 6 Aug 2019 12:49:18 +0200
sched/deadline: Fix double accounting of rq/running bw in push & pull
{push,pull}_dl_task() always calls {de,}activate_task() with .flags=0
which sets p->on_rq=TASK_ON_RQ_MIGRATING.
{push,pull}_dl_task()->{de,}activate_task()->{de,en}queue_task()->
{de,en}queue_task_dl() calls {sub,add}_{running,rq}_bw() since
p->on_rq==TASK_ON_RQ_MIGRATING.
So {sub,add}_{running,rq}_bw() in {push,pull}_dl_task() is
double-accounting for that task.
Fix it by removing rq/running bw accounting in [push/pull]_dl_task().
Fixes: 7dd778841164 ("sched/core: Unify p->on_rq updates")
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Valentin Schneider <valentin.schneider@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Luca Abeni <luca.abeni@santannapisa.it>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Qais Yousef <qais.yousef@arm.com>
Link: https://lkml.kernel.org/r/20190802145945.18702-2-dietmar.eggemann@arm.com
---
kernel/sched/deadline.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index ef5b9f6b1d42..46122edd8552 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -2088,17 +2088,13 @@ retry:
}
deactivate_task(rq, next_task, 0);
- sub_running_bw(&next_task->dl, &rq->dl);
- sub_rq_bw(&next_task->dl, &rq->dl);
set_task_cpu(next_task, later_rq->cpu);
- add_rq_bw(&next_task->dl, &later_rq->dl);
/*
* Update the later_rq clock here, because the clock is used
* by the cpufreq_update_util() inside __add_running_bw().
*/
update_rq_clock(later_rq);
- add_running_bw(&next_task->dl, &later_rq->dl);
activate_task(later_rq, next_task, ENQUEUE_NOCLOCK);
ret = 1;
@@ -2186,11 +2182,7 @@ static void pull_dl_task(struct rq *this_rq)
resched = true;
deactivate_task(src_rq, p, 0);
- sub_running_bw(&p->dl, &src_rq->dl);
- sub_rq_bw(&p->dl, &src_rq->dl);
set_task_cpu(p, this_cpu);
- add_rq_bw(&p->dl, &this_rq->dl);
- add_running_bw(&p->dl, &this_rq->dl);
activate_task(this_rq, p, 0);
dmin = p->dl.deadline;
next prev parent reply other threads:[~2019-08-06 11:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 14:59 [PATCH v2 0/3] sched/deadline: Fix double accounting in push_dl_task() & some cleanups Dietmar Eggemann
2019-08-02 14:59 ` [PATCH v2 1/3] sched/deadline: Fix double accounting of rq/running bw in push & pull Dietmar Eggemann
2019-08-06 11:19 ` tip-bot for Dietmar Eggemann [this message]
2019-08-02 14:59 ` [PATCH v2 2/3] sched/deadline: Use __sub_running_bw() throughout dl_change_utilization() Dietmar Eggemann
2019-08-02 14:59 ` [PATCH v2 3/3] sched/deadline: Cleanup on_dl_rq() handling Dietmar Eggemann
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=tip-f4904815f97a934258445a8f763f6b6c48f007e7@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bristot@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=hpa@zytor.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luca.abeni@santannapisa.it \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qais.yousef@arm.com \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.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®