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


Groups > linux.kernel > #1291270

Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity
Date 2015-12-14 16:20 +0100
Message-ID <qFD4T-7Rv-47@gated-at.bofh.it> (permalink)
References <qDGqd-4EB-3@gated-at.bofh.it> <qDGqe-4EB-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 08, 2015 at 10:19:30PM -0800, Steve Muckle wrote:
> From: Vincent Guittot <vincent.guittot@linaro.org>

> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 8b0a15e..9d9eb50 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -43,6 +43,24 @@ static inline int on_dl_rq(struct sched_dl_entity *dl_se)
>  	return !RB_EMPTY_NODE(&dl_se->rb_node);
>  }
>  
> +static void add_average_bw(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
> +{
> +	u64 se_bw = dl_se->dl_bw;
> +
> +	dl_rq->avg_bw += se_bw;
> +}
> +
> +static void clear_average_bw(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
> +{
> +	u64 se_bw = dl_se->dl_bw;
> +
> +	dl_rq->avg_bw -= se_bw;
> +	if (dl_rq->avg_bw < 0) {
> +		WARN_ON(1);
> +		dl_rq->avg_bw = 0;
> +	}
> +}


> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 4c49f76..ce05f61 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6203,6 +6203,14 @@ static unsigned long scale_rt_capacity(int cpu)
>  
>  	used = div_u64(avg, total);
>  
> +	/*
> +	 * deadline bandwidth is defined at system level so we must
> +	 * weight this bandwidth with the max capacity of the system.
> +	 * As a reminder, avg_bw is 20bits width and
> +	 * scale_cpu_capacity is 10 bits width
> +	 */
> +	used += div_u64(rq->dl.avg_bw, arch_scale_cpu_capacity(NULL, cpu));
> +
>  	if (likely(used < SCHED_CAPACITY_SCALE))
>  		return SCHED_CAPACITY_SCALE - used;
>  
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 08858d1..e44c6be 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -519,6 +519,8 @@ struct dl_rq {
>  #else
>  	struct dl_bw dl_bw;
>  #endif
> +	/* This is the "average utilization" for this runqueue */
> +	s64 avg_bw;
>  };

So I don't think this is right. AFAICT this projects the WCET as the
amount of time actually used by DL. This will, under many circumstances,
vastly overestimate the amount of time actually spend on it. Therefore
unduly pessimisme the fair capacity of this CPU.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-14 16:20 +0100
  Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-14 17:00 +0100
    Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Juri Lelli <Juri.Lelli@arm.com> - 2015-12-14 17:10 +0100
      Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-14 22:20 +0100
    Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-14 18:00 +0100
      Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-14 22:40 +0100
        Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-15 13:40 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 14:40 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-15 14:50 +0100
              Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 22:30 +0100
                Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Juri Lelli <Juri.Lelli@arm.com> - 2015-12-16 10:30 +0100
      Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 05:50 +0100
        Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-15 13:50 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 14:00 +0100
    Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-14 22:20 +0100
      Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 06:10 +0100
        Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 10:00 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-15 13:30 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 13:50 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 14:20 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Peter Zijlstra <peterz@infradead.org> - 2015-12-15 13:30 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 14:30 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 13:50 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 14:40 +0100
          Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in scale_rt_capacity Vincent Guittot <vincent.guittot@linaro.org> - 2015-12-15 14:00 +0100
            Re: [RFCv6 PATCH 09/10] sched: deadline: use deadline bandwidth in  scale_rt_capacity Luca Abeni <luca.abeni@unitn.it> - 2015-12-15 14:50 +0100

csiph-web