From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbdBMLKb (ORCPT ); Mon, 13 Feb 2017 06:10:31 -0500 Received: from merlin.infradead.org ([205.233.59.134]:59774 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbdBMLKa (ORCPT ); Mon, 13 Feb 2017 06:10:30 -0500 Date: Mon, 13 Feb 2017 12:10:25 +0100 From: Peter Zijlstra To: luca abeni Cc: Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Tommaso Cucinotta , Steven Rostedt Subject: Re: [PATCH 1/2] sched/deadline: Replenishment timer should fire in the next period Message-ID: <20170213111025.GG6500@twins.programming.kicks-ass.net> References: <77018c2ce2a17342b5d17cdb50209e667800b09a.1486754348.git.bristot@redhat.com> <20170211081237.0a9208be@sweethome> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170211081237.0a9208be@sweethome> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 11, 2017 at 08:12:37AM +0100, luca abeni wrote: > Hi Daniel, > > On Fri, 10 Feb 2017 20:48:10 +0100 > Daniel Bristot de Oliveira 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. > I've interpreted this as: Reviewed-by: Luca Abeni Holler if you disagree.