From: Juri Lelli <juri.lelli@arm.com>
To: luca abeni <luca.abeni@unitn.it>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@redhat.com, vincent.guittot@linaro.org,
wanpeng.li@hotmail.com
Subject: Re: [PATCH 1/2] sched/deadline: add per rq tracking of admitted bandwidth
Date: Thu, 11 Feb 2016 12:49:59 +0000 [thread overview]
Message-ID: <20160211124959.GO11415@e106622-lin> (raw)
In-Reply-To: <20160211134018.6b15fd68@utopia>
On 11/02/16 13:40, Luca Abeni wrote:
> On Thu, 11 Feb 2016 12:27:54 +0000
> Juri Lelli <juri.lelli@arm.com> wrote:
>
> > On 11/02/16 13:22, Luca Abeni wrote:
> > > Hi Juri,
> > >
> > > On Thu, 11 Feb 2016 12:12:57 +0000
> > > Juri Lelli <juri.lelli@arm.com> wrote:
> > > [...]
> > > > I think we still have (at least) two problems:
> > > >
> > > > - select_task_rq_dl, if we select a different target
> > > > - select_task_rq might make use of select_fallback_rq, if
> > > > cpus_allowed changed after the task went to sleep
> > > >
> > > > Second case is what creates the problem here, as we don't update
> > > > task_rq(p) and fallback_cpu ac_bw. I was thinking we might do so,
> > > > maybe adding fallback_cpu in task_struct, from
> > > > migrate_task_rq_dl() (it has to be added yes), but I fear that we
> > > > should hold both rq locks :/.
> > > >
> > > > Luca, did you already face this problem (if I got it right) and
> > > > thought of a way to fix it? I'll go back and stare a bit more at
> > > > those paths.
> > > In my patch I took care of the first case (modifying
> > > select_task_rq_dl() to move the utilization from the "old rq" to the
> > > "new rq"), but I never managed to trigger select_fallback_rq() in my
> > > tests, so I overlooked that case.
> > >
> >
> > Right, I was thinking to do the same. And you did that after grabbing
> > both locks, right?
>
> Not sure if I did everything correctly, but my code in
> select_task_rq_dl() currently looks like this (you can obviously
> ignore the "migrate_active" and "*_running_bw()" parts, and focus on
> the "*_rq_bw()" stuff):
> [...]
> if (rq != cpu_rq(cpu)) {
> int migrate_active;
>
> raw_spin_lock(&rq->lock);
> migrate_active = hrtimer_active(&p->dl.inactive_timer);
> if (migrate_active) {
> hrtimer_try_to_cancel(&p->dl.inactive_timer);
> sub_running_bw(&p->dl, &rq->dl);
> }
> sub_rq_bw(&p->dl, &rq->dl);
> raw_spin_unlock(&rq->lock);
> rq = cpu_rq(cpu);
Can't something happen here? My problem is that I use per-rq bw tracking
to save/restore root_domain state. So, I fear that a root_domain update
can happen while we are in the middle of moving bw from one cpu to
another.
> raw_spin_lock(&rq->lock);
> add_rq_bw(&p->dl, &rq->dl);
> if (migrate_active)
> add_running_bw(&p->dl, &rq->dl);
> raw_spin_unlock(&rq->lock);
> }
> [...]
>
> lockdep is not screaming, and I am not able to trigger any race
> condition or strange behaviour (I am currently at more than 24h of
> continuous stress-testing, but maybe my testcase is not so good in
> finding races here :)
>
Thanks for sharing what you have!
next prev parent reply other threads:[~2016-02-11 12:49 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 12:45 [PATCH 0/2] sched/deadline: fix cpusets bandwidth accounting Juri Lelli
2016-02-08 12:45 ` [PATCH 1/2] sched/deadline: add per rq tracking of admitted bandwidth Juri Lelli
2016-02-10 11:32 ` Juri Lelli
2016-02-10 11:43 ` luca abeni
2016-02-10 11:58 ` Juri Lelli
2016-02-19 13:43 ` luca abeni
2016-02-19 14:20 ` Steven Rostedt
2016-02-19 14:53 ` luca abeni
2016-02-19 14:57 ` Steven Rostedt
2016-02-22 11:03 ` luca abeni
2016-02-22 10:57 ` [PATCH 0/3] cleanup " Luca Abeni
2016-02-22 10:57 ` [PATCH 1/4] Move some calls to __dl_{sub,add}_ac() from core.c to deadline.c Luca Abeni
2016-02-22 10:57 ` [PATCH 2/4] Move the remaining __dl_{sub,add}_ac() calls " Luca Abeni
2016-02-22 10:57 ` [PATCH 3/4] Remove dl_new Luca Abeni
2016-02-23 15:42 ` Peter Zijlstra
2016-02-24 13:53 ` luca abeni
2016-02-25 9:46 ` Juri Lelli
2016-03-03 9:03 ` luca abeni
2016-03-03 9:28 ` Juri Lelli
2016-03-03 14:23 ` Steven Rostedt
2016-03-03 14:31 ` luca abeni
2016-03-03 16:12 ` Juri Lelli
2016-02-10 12:48 ` [PATCH 1/2] sched/deadline: add per rq tracking of admitted bandwidth luca abeni
2016-02-10 13:42 ` Juri Lelli
2016-02-23 15:48 ` Peter Zijlstra
2016-02-23 15:51 ` Juri Lelli
2016-02-10 14:37 ` Steven Rostedt
2016-02-10 16:27 ` Juri Lelli
2016-02-11 12:12 ` Juri Lelli
2016-02-11 12:22 ` luca abeni
2016-02-11 12:27 ` Juri Lelli
2016-02-11 12:40 ` luca abeni
2016-02-11 12:49 ` Juri Lelli [this message]
2016-02-11 13:05 ` luca abeni
2016-02-11 14:25 ` Steven Rostedt
2016-02-11 17:10 ` Juri Lelli
2016-02-12 17:05 ` Peter Zijlstra
2016-02-12 17:19 ` Juri Lelli
2016-02-24 19:17 ` Peter Zijlstra
2016-02-24 21:46 ` luca abeni
2016-02-25 7:53 ` Peter Zijlstra
2016-02-25 10:07 ` Juri Lelli
2016-02-25 10:20 ` Peter Zijlstra
2016-03-24 9:20 ` Peter Zijlstra
2016-02-11 21:48 ` Luca Abeni
2016-02-08 12:45 ` [PATCH 2/2] sched/deadline: rq_{online,offline}_dl for root_domain changes Juri Lelli
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=20160211124959.GO11415@e106622-lin \
--to=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@unitn.it \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=wanpeng.li@hotmail.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