Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1536765

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

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC v3 1/6] Track the active utilisation
Date 2016-12-06 09:40 +0100
Message-ID <sLjs5-87p-13@gated-at.bofh.it> (permalink)
References (2 earlier) <sw63L-3ER-11@gated-at.bofh.it> <sw6dr-3Ia-17@gated-at.bofh.it> <swaqJ-6ln-21@gated-at.bofh.it> <sESkX-8jW-53@gated-at.bofh.it> <sLa5s-244-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <peterz@infradead.org> 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->running_bw < old); /* overflow */
> > }
> > 
> > static void sub_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->running_bw > old); /* underflow */
> > }
> 
> I wanted to change "SCHED_WARN_ON(dl_rq->running_bw > old); /*
> underflow */" into "if (SCHED_WARN_ON(...)) dl_rq->running_bw = 0" (to
> avoid using nonsensical "running_bw" values), but I see that
> "SCHED_WARN_ON()" cannot be used inside an if (this seems to be a
> difference respect to "SCHED_WARN()").

There's a SCHED_WARN? Did you mean to say WARN_ON()?

And yes, mostly by accident I think, I'm not a big user of that pattern
and neglected it when I did SCHED_WARN_ON().

> 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 works. The
current ((void)(x)) thing was to avoid unused complaints -- although I'm
not sure there were any.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-12-05 23:40 +0100
  Re: [RFC v3 1/6] Track the active utilisation Peter Zijlstra <peterz@infradead.org> - 2016-12-06 09:40 +0100
    Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-12-06 10:00 +0100
    Re: [RFC v3 1/6] Track the active utilisation luca abeni <luca.abeni@unitn.it> - 2016-12-06 15:10 +0100

csiph-web