From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbcBWO3K (ORCPT ); Tue, 23 Feb 2016 09:29:10 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:36321 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbcBWO3I (ORCPT ); Tue, 23 Feb 2016 09:29:08 -0500 Date: Tue, 23 Feb 2016 15:29:02 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: LKML , Juri Lelli , Ingo Molnar , Clark Williams , Daniel Bristot de Oliveira , John Kacur , Thomas Gleixner Subject: Re: [RFC][PATCH] sched: Kick bandwidth timer immediately on start up Message-ID: <20160223142902.GR6357@twins.programming.kicks-ass.net> References: <20160216183746.349ec98b@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160216183746.349ec98b@gandalf.local.home> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2016 at 06:37:46PM -0500, Steven Rostedt wrote: > Index: linux-trace.git/kernel/sched/rt.c > =================================================================== > --- linux-trace.git.orig/kernel/sched/rt.c 2016-02-16 16:31:12.041035819 -0500 > +++ linux-trace.git/kernel/sched/rt.c 2016-02-16 16:31:19.997905282 -0500 > @@ -58,7 +58,15 @@ static void start_rt_bandwidth(struct rt > raw_spin_lock(&rt_b->rt_runtime_lock); > if (!rt_b->rt_period_active) { > rt_b->rt_period_active = 1; > - hrtimer_forward_now(&rt_b->rt_period_timer, rt_b->rt_period); > + /* > + * SCHED_DEADLINE updates the bandwidth, as a run away > + * RT task with a DL task could hog a CPU. But DL does > + * not reset the period. If a deadline task was running > + * without an RT task running, it can cause RT tasks to > + * throttle when they start up. Kick the timer right away > + * to update the period. > + */ > + hrtimer_forward_now(&rt_b->rt_period_timer, ns_to_ktime(0)); That's a bit icky, but yeah, probably the best we can do without making a giant mess of things.. > hrtimer_start_expires(&rt_b->rt_period_timer, HRTIMER_MODE_ABS_PINNED); > } > raw_spin_unlock(&rt_b->rt_runtime_lock);