From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756409AbcB0LiQ (ORCPT ); Sat, 27 Feb 2016 06:38:16 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38485 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756241AbcB0LiO convert rfc822-to-8bit (ORCPT ); Sat, 27 Feb 2016 06:38:14 -0500 Date: Sat, 27 Feb 2016 12:37:57 +0100 From: luca abeni To: Peter Zijlstra Cc: Juri Lelli , linux-kernel@vger.kernel.org Subject: Re: Question about prio_changed_dl() Message-ID: <20160227123757.36cee2d3@utopia> In-Reply-To: <20160225145202.GQ6356@twins.programming.kicks-ass.net> References: <20160219134345.70ff4aa0@utopia> <20160225140149.GK6357@twins.programming.kicks-ass.net> <20160225152558.2fbac9e5@utopia> <20160225145202.GQ6356@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Feb 2016 15:52:02 +0100 Peter Zijlstra wrote: > On Thu, Feb 25, 2016 at 03:25:58PM +0100, luca abeni wrote: > > > > > (BTW, it seems to me that switched_to_dl() is never invoked, for > > > > some reason...) > > > > > > Hmm, it should be invoked if you do sched_setattr() to get > > > SCHED_DEADLINE. > > > > Sorry, that was me being confused... > > It is prio_changed_dl() that is not invoked when the deadline > > parameters are changed (I am testing a change to fix this - it actually > > is included in the "Move the remaining __dl_{sub,add}_ac() calls from > > core.c to deadline.c" patch I posted on Monday; I am going to extract > > it in a separate patch). > > Ah ok. So the idea was that the || dl_task() part would ensure > ->prio_changed() would always be called. > > I'll await your patch. >>From 5a0bde5332bc1cc5701b2d9799f6ec197c1572cc Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Fri, 26 Feb 2016 09:56:24 +0100 Subject: sched/core: fix __sched_setscheduler() to properly invoke prio_changed_dl() Currently, prio_changed_dl() is not called when __sched_setscheduler() changes the parameters of a SCHED_DEADLINE task. This happens because when changing parameters deadline tasks do not change their priority, so new_effective_prio == oldprio. The issue is fixed by explicitly checking if the task is a deadline task. Signed-off-by: Luca Abeni --- kernel/sched/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9503d59..5646bde 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4079,6 +4079,8 @@ change: new_effective_prio = rt_mutex_get_effective_prio(p, newprio); if (new_effective_prio == oldprio) { __setscheduler_params(p, attr); + if (p->sched_class == &dl_sched_class) + p->sched_class->prio_changed(rq, p, oldprio); task_rq_unlock(rq, p, &flags); return 0; } -- 2.5.0