Re: [RFC v3 1/6] Track the active utilisation

2016-12-06 Thread luca abeni
Hi Peter, On Tue, 6 Dec 2016 09:35:01 +0100 Peter Zijlstra wrote: [...] > > This is because of the definition used when CONFIG_SCHED_DEBUG is > > not defined (I noticed the issue when testing with random kernel > > configurations). > > I'm fine changing the definition, just find something that

Re: [RFC v3 1/6] Track the active utilisation

2016-12-06 Thread luca abeni
On Tue, 6 Dec 2016 09:35:01 +0100 Peter Zijlstra wrote: > On Mon, Dec 05, 2016 at 11:30:05PM +0100, luca abeni wrote: > > Hi Peter, > > > > On Fri, 18 Nov 2016 15:23:59 +0100 > > Peter Zijlstra wrote: > > [...] > > > u64 running_bw; > > > > > > static void add_running_bw(struct sched_dl_en

Re: [RFC v3 1/6] Track the active utilisation

2016-12-06 Thread Peter Zijlstra
On Mon, Dec 05, 2016 at 11:30:05PM +0100, luca abeni wrote: > Hi Peter, > > On Fri, 18 Nov 2016 15:23:59 +0100 > Peter Zijlstra wrote: > [...] > > u64 running_bw; > > > > static void add_running_bw(struct sched_dl_entity *dl_se, struct > > dl_rq *dl_rq) { > > u64 old = dl_rq->running_bw;

Re: [RFC v3 1/6] Track the active utilisation

2016-12-05 Thread luca abeni
Hi Peter, On Fri, 18 Nov 2016 15:23:59 +0100 Peter Zijlstra wrote: [...] > u64 running_bw; > > static void add_running_bw(struct sched_dl_entity *dl_se, struct > dl_rq *dl_rq) { > u64 old = dl_rq->running_bw; > > dl_rq->running_bw += dl_se->dl_bw; > SCHED_WARN_ON(dl_rq->

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread Steven Rostedt
On Fri, 18 Nov 2016 15:23:59 +0100 Peter Zijlstra wrote: > That said; there's something to be said for: > > u64 running_bw; > > static void add_running_bw(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq) > { > u64 old = dl_rq->running_bw; > > dl_rq->running_bw += dl_se->

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread Peter Zijlstra
On Fri, Nov 18, 2016 at 04:10:17PM +0100, luca abeni wrote: > Ok; I originally made it signed because I wanted the "running_bw < 0" > check, but I can change it to "dl_rq->running_bw > old" (I did not > think about it). Happy accident of me staring at unsigned over/under-flow for the past several

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread luca abeni
On Fri, 18 Nov 2016 15:23:59 +0100 Peter Zijlstra wrote: > On Tue, Oct 25, 2016 at 09:58:11AM -0400, Steven Rostedt wrote: > > > I agree with Daniel, especially since I don't usually trust the > > compiler. And the added variable is more of a distraction as it > > doesn't seem to have any real p

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread luca abeni
Hi Peter, On Fri, 18 Nov 2016 14:55:54 +0100 Peter Zijlstra wrote: > On Mon, Oct 24, 2016 at 04:06:33PM +0200, Luca Abeni wrote: > > > @@ -498,6 +514,8 @@ static void update_dl_entity(struct > > sched_dl_entity *dl_se, struct dl_rq *dl_rq = dl_rq_of_se(dl_se); > > struct rq *rq = rq_of_dl_r

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread Peter Zijlstra
On Tue, Nov 08, 2016 at 05:56:35PM +, Juri Lelli wrote: > Mmm. You explicitly check that TASK_ON_RQ_MIGRATING or DEQUEUE_SLEEP > (which btw can be actually put together with an or condition), so I > don't think that any of those turn out to be true when the task dies. > Also, AFAIU, do_exit() w

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread Peter Zijlstra
On Tue, Oct 25, 2016 at 09:58:11AM -0400, Steven Rostedt wrote: > I agree with Daniel, especially since I don't usually trust the > compiler. And the added variable is more of a distraction as it doesn't > seem to have any real purpose. I don't think there's anything here to trust the compiler on

Re: [RFC v3 1/6] Track the active utilisation

2016-11-18 Thread Peter Zijlstra
On Mon, Oct 24, 2016 at 04:06:33PM +0200, Luca Abeni wrote: > @@ -498,6 +514,8 @@ static void update_dl_entity(struct sched_dl_entity > *dl_se, > struct dl_rq *dl_rq = dl_rq_of_se(dl_se); > struct rq *rq = rq_of_dl_rq(dl_rq); > > + add_running_bw(dl_se, dl_rq); > + > if (d

Re: [RFC v3 1/6] Track the active utilisation

2016-11-09 Thread luca abeni
On Tue, 8 Nov 2016 17:56:35 + Juri Lelli wrote: [...] > > > > @@ -947,14 +965,19 @@ static void enqueue_task_dl(struct rq *rq, struct > > > > task_struct *p, int flags) > > > > return; > > > > } > > > > > > > > + if (p->on_rq == TASK_ON_RQ_MIGRATING) > > > > +

Re: [RFC v3 1/6] Track the active utilisation

2016-11-09 Thread luca abeni
On Tue, 8 Nov 2016 20:02:29 + Juri Lelli wrote: [...] > > > So, it actually matters for next patch, > > > not here. But, maybe we want to do things clean from start? > > You mean, because patch 2/6 adds > > + if (hrtimer_active(&p->dl.inactive_timer)) { > > + raw_spin_loc

Re: [RFC v3 1/6] Track the active utilisation

2016-11-08 Thread Juri Lelli
On 08/11/16 20:09, Luca Abeni wrote: > Hi again, > > On Tue, 8 Nov 2016 18:53:09 + > Juri Lelli wrote: > [...] > > > > Also, AFAIU, do_exit() works on current and the TASK_DEAD case is > > > > handled in finish_task_switch(), so I don't think we are taking > > > > care of the "task is dying"

Re: [RFC v3 1/6] Track the active utilisation

2016-11-08 Thread Luca Abeni
Hi again, On Tue, 8 Nov 2016 18:53:09 + Juri Lelli wrote: [...] > > > Also, AFAIU, do_exit() works on current and the TASK_DEAD case is > > > handled in finish_task_switch(), so I don't think we are taking > > > care of the "task is dying" condition. > > Ok, so I am missing something... The s

Re: [RFC v3 1/6] Track the active utilisation

2016-11-08 Thread Juri Lelli
On 08/11/16 19:17, Luca Abeni wrote: > Hi Juri, > > On Tue, 8 Nov 2016 17:56:35 + > Juri Lelli wrote: > [...] > > > > > static void switched_to_dl(struct rq *rq, struct task_struct > > > > > *p) { > > > > > + add_running_bw(&p->dl, &rq->dl); > > > > > > > > > > /* If p is not que

Re: [RFC v3 1/6] Track the active utilisation

2016-11-08 Thread Luca Abeni
Hi Juri, On Tue, 8 Nov 2016 17:56:35 + Juri Lelli wrote: [...] > > > > static void switched_to_dl(struct rq *rq, struct task_struct > > > > *p) { > > > > + add_running_bw(&p->dl, &rq->dl); > > > > > > > > /* If p is not queued we will update its parameters at > > > > next wak

Re: [RFC v3 1/6] Track the active utilisation

2016-11-08 Thread Juri Lelli
On 01/11/16 22:10, Luca Abeni wrote: > Hi Juri, > > On Tue, 1 Nov 2016 16:45:43 + > Juri Lelli wrote: > > > Hi, > > > > a few nitpicks on subject and changelog and a couple of questions below. > > > > Subject should be changed to something like > > > > sched/deadline: track the active ut

Re: [RFC v3 1/6] Track the active utilisation

2016-11-01 Thread luca abeni
Hi Juri, On Tue, 1 Nov 2016 16:45:43 + Juri Lelli wrote: > Hi, > > a few nitpicks on subject and changelog and a couple of questions below. > > Subject should be changed to something like > > sched/deadline: track the active utilisation Ok; that's easy :) I guess a similar change should

Re: [RFC v3 1/6] Track the active utilisation

2016-11-01 Thread Juri Lelli
Hi, a few nitpicks on subject and changelog and a couple of questions below. Subject should be changed to something like sched/deadline: track the active utilisation On 24/10/16 16:06, Luca Abeni wrote: > The active utilisation here is defined as the total utilisation of the s/The active/Acti

Re: [RFC v3 1/6] Track the active utilisation

2016-10-25 Thread Luca Abeni
On Tue, 25 Oct 2016 09:58:11 -0400 Steven Rostedt wrote: > On Tue, 25 Oct 2016 11:29:16 +0200 > luca abeni wrote: > > > Hi Daniel, > > > > On Tue, 25 Oct 2016 11:09:52 +0200 > > Daniel Bristot de Oliveira wrote: > > [...] > > > > +static void add_running_bw(struct sched_dl_entity *dl_se, > >

Re: [RFC v3 1/6] Track the active utilisation

2016-10-25 Thread Steven Rostedt
On Tue, 25 Oct 2016 11:29:16 +0200 luca abeni wrote: > Hi Daniel, > > On Tue, 25 Oct 2016 11:09:52 +0200 > Daniel Bristot de Oliveira wrote: > [...] > > > +static void add_running_bw(struct sched_dl_entity *dl_se, struct > > > dl_rq *dl_rq) +{ > > > + u64 se_bw = dl_se->dl_bw; > > > + > > > + d

Re: [RFC v3 1/6] Track the active utilisation

2016-10-25 Thread luca abeni
Hi Daniel, On Tue, 25 Oct 2016 11:09:52 +0200 Daniel Bristot de Oliveira wrote: [...] > > +static void add_running_bw(struct sched_dl_entity *dl_se, struct > > dl_rq *dl_rq) +{ > > + u64 se_bw = dl_se->dl_bw; > > + > > + dl_rq->running_bw += se_bw; > > +} > > why not... > > static *inline

Re: [RFC v3 1/6] Track the active utilisation

2016-10-25 Thread Daniel Bristot de Oliveira
Il 24/10/2016 16:06, Luca Abeni ha scritto: > The active utilisation here is defined as the total utilisation of the > active (TASK_RUNNING) tasks queued on a runqueue. Hence, it is increased > when a task wakes up and is decreased when a task blocks. > > When a task is migrated from CPUi to CPUj,

[RFC v3 1/6] Track the active utilisation

2016-10-24 Thread Luca Abeni
The active utilisation here is defined as the total utilisation of the active (TASK_RUNNING) tasks queued on a runqueue. Hence, it is increased when a task wakes up and is decreased when a task blocks. When a task is migrated from CPUi to CPUj, immediately subtract the task's utilisation from CPUi