From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbdBOOQz (ORCPT ); Wed, 15 Feb 2017 09:16:55 -0500 Received: from foss.arm.com ([217.140.101.70]:56100 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbdBOOQy (ORCPT ); Wed, 15 Feb 2017 09:16:54 -0500 Date: Wed, 15 Feb 2017 14:16:51 +0000 From: Juri Lelli To: Daniel Bristot de Oliveira Cc: Luca Abeni , Steven Rostedt , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tommaso Cucinotta , Mike Galbraith , Romulo Silva de Oliveira Subject: Re: [PATCH 3/2] sched/deadline: Use deadline instead of period when calculating overflow Message-ID: <20170215141651.GF1368@e106622-lin> References: <20170214142848.4e62a91f@gandalf.local.home> <20170214234926.6b415428@sweethome> <20170214191417.4dd96145@gandalf.local.home> <20170215084003.4d123e5b@luca> <20170215102919.GA1368@e106622-lin> <20170215133136.664c1bfe@luca> <20170215125925.GD1368@e106622-lin> <0b3af651-ad0d-e74b-ea02-f8706ad13bbb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b3af651-ad0d-e74b-ea02-f8706ad13bbb@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/02/17 14:33, Daniel Bristot de Oliveira wrote: > On 02/15/2017 01:59 PM, Juri Lelli wrote: > > Actually, another thing that we noticed, talking on IRC with Peter, is > > that we seem to be replenishing differently on different occasions: > > When a task is awakened (not by the replenishment timer), it is not > possible to know if the absolute deadline var stores the absolute > deadline of activation which took place in the instant > (current time) - dl_period. > > Therefore, assuming the next deadline is one dl_deadline away from now > is correct. > > IOW: that is a sporadic activation - the task is activated after at > least minimum inter-arrival time between activation/replenishment: > > > - on wakeup (if overflowing) we do > > > > dl_se->deadline = rq_clock(rq) + pi_se->dl_deadline; > > dl_se->runtime = pi_se->dl_runtime; > > > In the replenishment timer, it is known that the absolute deadline > instant of the previous activation is in the deadline var. So > putting the absolute deadline one dl_period away is correct [1]. > > Another point is that this case avoids creating time drift due > to latencies. For instance, in the case of a 1 ms delay of the timer > (interrupts disabled?), the wakeup replenishment would push the > absolute a relative deadline + 1 ms away from the previous deadline. > > IOW: the replenishment timer makes the periodic case - a fixed time > offset from the previous activation/replenishment. > > > - when the replenishment timer fires (un-thottle and with runtime < 0) > > > > dl_se->deadline += pi_se->dl_period; > > dl_se->runtime += pi_se->dl_runtime; > > So I think it is correct. Am I missing something? > Nope, you are right, no problems here. Thanks, - Juri