lkml.org 
[lkml]   [2016]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v3 1/6] Track the active utilisation
Hi Daniel,

On Tue, 25 Oct 2016 11:09:52 +0200
Daniel Bristot de Oliveira <bristot@redhat.com> 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*
> void add_running_bw(struct sched_dl_entity *dl_se, struct dl_rq
> *dl_rq) {
> dl_rq->running_bw += dl_se->dl_bw;
> }
>
> am I missing something?

I do not know... Maybe I am the one missing something :)
I assumed that the compiler is smart enough to inline the function (and
to avoid creating a local variable on the stack), but if there is
agreement I can change the function in this way.



Thanks,
Luca


>
> > +static void sub_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;
> > + if (WARN_ON(dl_rq->running_bw < 0))
> > + dl_rq->running_bw = 0;
> > +}
>
> (if I am not missing anything...)
>
> the same in the above function: use inline and remove the se_bw
> variable.
>
> -- Daniel

\
 
 \ /
  Last update: 2016-10-25 11:30    [W:0.196 / U:2.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site