From patchwork Tue Feb 25 16:05:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 25301 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0D01C20143 for ; Tue, 25 Feb 2014 16:05:34 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id c14sf1459013vea.2 for ; Tue, 25 Feb 2014 08:05:34 -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=yf5uQ7aS6Afr6xxtI85MaVftDGgol3FBV3/tdazupsY=; b=f7mK4w8xoDy+rjgvNJ4/T87Oeua2OChQKBKieblqryrAY7lbOEUAajwxm3FQdfKzgX +PRZ7XQxsegoDFqMTdKF2l9JgpGyb7nnFjJaZhbPcqofgejxdVc4U5/WM8V1rwKwAd3Y X4DJF3VUWdY9inRIfG0EJhdw2SHt0TBhCJ9XgcMZuMWKCtsvt2evpkboTHm299Z1u/qx EZSVYNHepR3A8JlaktVT7jfrmyOd2nb3wngy1in1bicLESwjKjRmn3mnMU/LZfRE1Yns Pk32IU1WgxWyrN11WeV4VmXUjmTJ1spj7eTkDhLV/jqv9PSRBUsUgSFUi6xMgyP3wBDK PFcg== X-Gm-Message-State: ALoCoQkiATI9xNeWzYvJxVddQbEXLgCh3ehV2NNPBpyFbfB3qhdf0f1aIMVTM0PKRGu1LFZJ6ggx X-Received: by 10.236.27.33 with SMTP id d21mr156016yha.23.1393344334790; Tue, 25 Feb 2014 08:05:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.100 with SMTP id 91ls2507864qgi.18.gmail; Tue, 25 Feb 2014 08:05:34 -0800 (PST) X-Received: by 10.58.161.227 with SMTP id xv3mr1423887veb.31.1393344334616; Tue, 25 Feb 2014 08:05:34 -0800 (PST) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id a5si6920076vez.6.2014.02.25.08.05.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 08:05:34 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::232; Received: by mail-ve0-f178.google.com with SMTP id jy13so671583veb.9 for ; Tue, 25 Feb 2014 08:05:34 -0800 (PST) X-Received: by 10.52.68.106 with SMTP id v10mr223156vdt.59.1393344334367; Tue, 25 Feb 2014 08:05:34 -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.220.174.196 with SMTP id u4csp149469vcz; Tue, 25 Feb 2014 08:05:33 -0800 (PST) X-Received: by 10.68.212.10 with SMTP id ng10mr446934pbc.95.1393344333490; Tue, 25 Feb 2014 08:05:33 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tu2si4040738pbc.219.2014.02.25.08.05.32; Tue, 25 Feb 2014 08:05:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276AbaBYQF0 (ORCPT + 26 others); Tue, 25 Feb 2014 11:05:26 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:36992 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbaBYQFZ (ORCPT ); Tue, 25 Feb 2014 11:05:25 -0500 Received: by mail-ea0-f178.google.com with SMTP id a15so222432eae.37 for ; Tue, 25 Feb 2014 08:05:24 -0800 (PST) X-Received: by 10.15.86.11 with SMTP id h11mr781302eez.8.1393344324270; Tue, 25 Feb 2014 08:05:24 -0800 (PST) Received: from neville.retis (nat-cataldo.sssup.it. [193.205.81.5]) by mx.google.com with ESMTPSA id i1sm28236640eeo.16.2014.02.25.08.05.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 08:05:23 -0800 (PST) From: Juri Lelli To: mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, Juri Lelli Subject: [PATCH] sched/rt: fix rt timer activation/deactivation Date: Tue, 25 Feb 2014 17:05:28 +0100 Message-Id: <1393344328-16653-1-git-send-email-juri.lelli@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: juri.lelli@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com 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: , Destroy rt bandwidth timer when rq has no more RT tasks, even when CONFIG_RT_GROUP_SCHED is not set. Signed-off-by: Juri Lelli --- kernel/sched/rt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index a2740b7..7dba25a 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -86,12 +86,12 @@ void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq) raw_spin_lock_init(&rt_rq->rt_runtime_lock); } -#ifdef CONFIG_RT_GROUP_SCHED static void destroy_rt_bandwidth(struct rt_bandwidth *rt_b) { hrtimer_cancel(&rt_b->rt_period_timer); } +#ifdef CONFIG_RT_GROUP_SCHED #define rt_entity_is_task(rt_se) (!(rt_se)->my_q) static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se) @@ -1011,8 +1011,12 @@ inc_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) start_rt_bandwidth(&def_rt_bandwidth); } -static inline -void dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) {} +static void +dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) +{ + if (!rt_rq->rt_nr_running) + destroy_rt_bandwidth(&def_rt_bandwidth); +} #endif /* CONFIG_RT_GROUP_SCHED */