From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbdBWGP3 (ORCPT ); Thu, 23 Feb 2017 01:15:29 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:50033 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdBWGP0 (ORCPT ); Thu, 23 Feb 2017 01:15:26 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.249.26 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Thu, 23 Feb 2017 15:14:20 +0900 From: Byungchul Park To: , CC: , , , Subject: Re: [PATCH v2 2/2] sched/deadline: Change the way to replenish runtime for sleep tasks Message-ID: <20170223061420.GD3817@X58A-UD3R> References: <1487819438-3364-1-git-send-email-byungchul.park@lge.com> <1487819438-3364-2-git-send-email-byungchul.park@lge.com> <008a01d28d83$8d0605a0$a71210e0$@lge.com> MIME-Version: 1.0 In-Reply-To: <008a01d28d83$8d0605a0$a71210e0$@lge.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/02/23 15:14:26, Serialize by Router on LGEKRMHUB06/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/02/23 15:14:26, Serialize complete at 2017/02/23 15:14:26 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2017 at 12:18:48PM +0900, byungchul.park wrote: > > Current code handles this by replenishing a runtime in hrtimer callback > > for deadline. But this approach has room for improvement in two ways: > > > > 1. No need to keep the hrtimer for a sleep task because it can be > > handled when waking it up. > > > > 2. It will be replenished twice unnecessarily if the task sleeps for > > long time so that the deadline, assigned in the hrtimer callback, > > also passed. In other words, one happens in the callback and the > > other happens in update_dl_entiry() when waking it up. I wanted to enhance not only the second but also the first, so remove the unnecessary timer overhead for sleep tasks. It's possible but it makes code too complecated and I won't do that. I will resend a patch doing only the second one at the next spin. Thank you, Byungchul > > @@ -981,6 +983,9 @@ static void dequeue_task_dl(struct rq *rq, struct > > task_struct *p, int flags) > > { > > update_curr_dl(rq); > > __dequeue_task_dl(rq, p, flags); > > + > > + if (flags & DEQUEUE_SLEEP) > > + hrtimer_try_to_cancel(&p->dl.dl_timer); > > Sorry. I found I might have made a mistake. I might have to re-start the > timer when waking it up if necessary. Let me think more.