From patchwork Wed Feb 4 13:28:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pang.xunlei" X-Patchwork-Id: 44335 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 64D8D21513 for ; Wed, 4 Feb 2015 13:28:37 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id u56sf1334090wes.2 for ; Wed, 04 Feb 2015 05:28:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=bJslXJ9wn1ozncBqBu3Hp9C2OTmEZG3emhgv4c21Msw=; b=l1vV8d2d0XOK47Uzg0kcoPv3QQJ9SyYBsfJGoIvoVEIL64n9D6efd4erPenNDGcUMU Cgvlf/WyJ9f3+OM+UxAXPJBa3KSbupxWrncb2117YT8OBtuCL2szCX9BlkkdlnhHVYrV EXxwK3sN0+e5kM0s4mLrnwIxYugy5RZKIPZH2yZ2s4CXXCMMuxohVG4Idxavh4IfNR/2 sfw+wykDeKncQp250j25dqa85PKgwBGTX0PkxCFAyryjfL57a7Kjseqp/TRx1zklLchy H0bgl/8bsDo4wljGH5lEKtJEws8wzmjioghET/qyiwQM0lIJOqnzlRL8Th1xSSu92SCC JkRg== X-Gm-Message-State: ALoCoQkyk2RBjif4IBuQgKrYep5mh4SQvX/AmfSpJVT1BIvbIL2Wj07YEbRIrWh5PIZK5ic9IPMw X-Received: by 10.112.51.100 with SMTP id j4mr3781501lbo.24.1423056516471; Wed, 04 Feb 2015 05:28:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.193 with SMTP id g1ls30811laf.14.gmail; Wed, 04 Feb 2015 05:28:36 -0800 (PST) X-Received: by 10.112.129.228 with SMTP id nz4mr3021843lbb.8.1423056516238; Wed, 04 Feb 2015 05:28:36 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id jt16si1377535lab.9.2015.02.04.05.28.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 05:28:36 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so1547622lab.1 for ; Wed, 04 Feb 2015 05:28:36 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr30266258lbc.24.1423056516134; Wed, 04 Feb 2015 05:28:36 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp486204lbj; Wed, 4 Feb 2015 05:28:35 -0800 (PST) X-Received: by 10.68.168.164 with SMTP id zx4mr45708316pbb.117.1423056514315; Wed, 04 Feb 2015 05:28:34 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si2225427pdj.58.2015.02.04.05.28.28; Wed, 04 Feb 2015 05:28:34 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933842AbbBDN2Z (ORCPT + 29 others); Wed, 4 Feb 2015 08:28:25 -0500 Received: from mail-yh0-f48.google.com ([209.85.213.48]:51408 "EHLO mail-yh0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933725AbbBDN2V (ORCPT ); Wed, 4 Feb 2015 08:28:21 -0500 Received: by mail-yh0-f48.google.com with SMTP id a41so632086yho.7 for ; Wed, 04 Feb 2015 05:28:21 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.236.41.105 with SMTP id g69mr12149980yhb.55.1423056501106; Wed, 04 Feb 2015 05:28:21 -0800 (PST) Received: by 10.170.86.193 with HTTP; Wed, 4 Feb 2015 05:28:21 -0800 (PST) In-Reply-To: <1418920263-21358-1-git-send-email-pang.xunlei@linaro.org> References: <1418920263-21358-1-git-send-email-pang.xunlei@linaro.org> Date: Wed, 4 Feb 2015 21:28:21 +0800 Message-ID: Subject: Re: [PATCH] sched/deadline: Add update_rq_clock() in yield_task_dl() From: Xunlei Pang To: Kirill Tkhai Cc: Peter Zijlstra , Juri Lelli , Xunlei Pang , lkml Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pang.xunlei@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi Kirill, I've also sent out this similar patch to yours before, and I agree with you on this point :-) But with the latest modification which peter made, ( see: cebde6d681aa45f96111cfcffc1544cf2a0454ff ) I think it would be better to add a skip operation after update_curr_dl(rq) like below: --- kernel/sched/deadline.c | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.1 On 19 December 2014 at 00:31, Xunlei Pang wrote: > yield_task_dl() calls update_curr_dl() which calls start_dl_timer() > to throttle current task. But yield_task_dl() doesn't update the rq > clock which will cause start_dl_timer() to set the wrong dl_timer > which may be much later than current deadline time. > > For instance, in systems with 100HZ tick, if there're few dl-tasks, > then rq clock will mainly depend on the tick to update its value. > If we choose the CONFIG_NO_HZ_FULL_ALL feature, things may get even > worse. > > Moreover, there're some statistics in update_curr_dl() also relying > on rq clock, like rq_clock_task(). > > Thus, in yield_task_dl(), we should add update_rq_clock() before > update_curr_dl(). > > Signed-off-by: Xunlei Pang > --- > kernel/sched/deadline.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index e5db8c6..5648e62 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -915,7 +915,11 @@ static void yield_task_dl(struct rq *rq) > rq->curr->dl.dl_yielded = 1; > p->dl.runtime = 0; > } > + > + update_rq_clock(rq); > update_curr_dl(rq); > + /* Will go to schedule(), to avoid another clock update. */ > + rq->skip_clock_update = 1; > } > > #ifdef CONFIG_SMP > -- > 1.9.1 > -- 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/ diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index e5db8c6..5648e62 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -915,7 +915,11 @@ static void yield_task_dl(struct rq *rq) rq->curr->dl.dl_yielded = 1; p->dl.runtime = 0; } + + update_rq_clock(rq); update_curr_dl(rq); + /* Will go to schedule(), to avoid another clock update. */ + rq_clock_skip_update(rq, true); } #ifdef CONFIG_SMP