lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170211081237.0a9208be@sweethome>
Date:   Sat, 11 Feb 2017 08:12:37 +0100
From:   luca abeni <luca.abeni@...tannapisa.it>
To:     Daniel Bristot de Oliveira <bristot@...hat.com>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@....com>,
        Tommaso Cucinotta <tommaso.cucinotta@...up.it>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 1/2] sched/deadline: Replenishment timer should fire in
 the next period

Hi Daniel,

On Fri, 10 Feb 2017 20:48:10 +0100
Daniel Bristot de Oliveira <bristot@...hat.com> wrote:

[...]
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 70ef2b1..3c94d85 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -505,10 +505,15 @@ static void update_dl_entity(struct
> sched_dl_entity *dl_se, }
>  }
>  
> +static inline u64 dl_next_period(struct sched_dl_entity *dl_se)
> +{
> +	return dl_se->deadline - dl_se->dl_deadline +
> dl_se->dl_period; +}
> +
>  /*
>   * If the entity depleted all its runtime, and if we want it to sleep
>   * while waiting for some new execution time to become available, we
> - * set the bandwidth enforcement timer to the replenishment instant
> + * set the bandwidth replenishment timer to the replenishment instant
>   * and try to activate it.
>   *
>   * Notice that it is important for the caller to know if the timer
> @@ -530,7 +535,7 @@ static int start_dl_timer(struct task_struct *p)
>  	 * that it is actually coming from rq->clock and not from
>  	 * hrtimer's time base reading.
>  	 */
> -	act = ns_to_ktime(dl_se->deadline);
> +	act = ns_to_ktime(dl_next_period(dl_se));

Looks like there is a real bug in the code, and your fix looks correct
to me. I think it should be committed.


			Thanks,
				Luca


>  	now = hrtimer_cb_get_time(timer);
>  	delta = ktime_to_ns(now) - rq_clock(rq);
>  	act = ktime_add_ns(act, delta);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ