From patchwork Thu Dec 18 16:31:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pang.xunlei" X-Patchwork-Id: 42463 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F9A826C6B for ; Thu, 18 Dec 2014 16:32:11 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id x12sf1028708wgg.4 for ; Thu, 18 Dec 2014 08:32:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=uKbFW/IPAfACQwmDh5trZuJ1gUH5zH/svQAQX8z1jLg=; b=J07T7/NH7Xk+0QvA0t88d8rbFsj61mJ8SkUS/jGo0Q8Qo3C09UL9CqIZzq9uQcFpGB vqayN1CO+5ZGelXVwCawaF5/BeUMvksmZngbNL+aiSyvs/j2WbQ2PGyTcpbUN0pAScn0 d8zhmI/05YeA5D2a8rtR72x++St27PLRUJvUULtOZwFJvMkse6UVE45k+/tu0BGmZBjs uqYnsI8IsDb+akGmwYNXM2xspgQqrhTQs6y4ND/oHbrd5+dX/VMbAG5IDnqFHskuqRNz TdxpSjpsUT5e6LUKptJoTXzfA+2WOCb/emWOCZNcXQzIAa2qm/cI6pfKSnWIneixw143 rXsw== X-Gm-Message-State: ALoCoQni1LU0xP5DBiSI5fUpvcT9E4uAgB1w37Z67E2MeazkEAfYietp+cqu18K7STaCJHhwFcgE X-Received: by 10.180.77.167 with SMTP id t7mr238407wiw.6.1418920330941; Thu, 18 Dec 2014 08:32:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.226 with SMTP id kt2ls1186052lac.52.gmail; Thu, 18 Dec 2014 08:32:10 -0800 (PST) X-Received: by 10.152.36.165 with SMTP id r5mr3076045laj.93.1418920330681; Thu, 18 Dec 2014 08:32:10 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id yt7si7247963lbb.8.2014.12.18.08.32.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 08:32:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id s18so1325868lam.16 for ; Thu, 18 Dec 2014 08:32:10 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr3136584laf.81.1418920330563; Thu, 18 Dec 2014 08:32:10 -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.142.69 with SMTP id ru5csp1761470lbb; Thu, 18 Dec 2014 08:32:09 -0800 (PST) X-Received: by 10.70.118.1 with SMTP id ki1mr4802627pdb.69.1418920328318; Thu, 18 Dec 2014 08:32:08 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dp1si10749625pdb.139.2014.12.18.08.31.37; Thu, 18 Dec 2014 08:32:07 -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 S1751936AbaLRQbf (ORCPT + 27 others); Thu, 18 Dec 2014 11:31:35 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:47795 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbaLRQbe (ORCPT ); Thu, 18 Dec 2014 11:31:34 -0500 Received: by mail-pa0-f52.google.com with SMTP id eu11so1698090pac.39 for ; Thu, 18 Dec 2014 08:31:33 -0800 (PST) X-Received: by 10.68.251.37 with SMTP id zh5mr4842762pbc.120.1418920292439; Thu, 18 Dec 2014 08:31:32 -0800 (PST) Received: from localhost.localdomain ([210.21.223.3]) by mx.google.com with ESMTPSA id by8sm5037251pab.25.2014.12.18.08.31.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Dec 2014 08:31:31 -0800 (PST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Juri Lelli , Xunlei Pang Subject: [PATCH] sched/deadline: Add update_rq_clock() in yield_task_dl() Date: Fri, 19 Dec 2014 00:31:03 +0800 Message-Id: <1418920263-21358-1-git-send-email-pang.xunlei@linaro.org> X-Mailer: git-send-email 1.9.1 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.43 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: , 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