Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751731AbZIWEyt (ORCPT ); Wed, 23 Sep 2009 00:54:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751426AbZIWEys (ORCPT ); Wed, 23 Sep 2009 00:54:48 -0400 Received: from nskntqsrv03p.mx.bigpond.com ([61.9.168.237]:17740 "EHLO nskntqsrv03p.mx.bigpond.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbZIWEys (ORCPT ); Wed, 23 Sep 2009 00:54:48 -0400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH] sched: Make sure task has correct sched_class after policy change X-Mercurial-Node: e286470be617e07797b7f45d4b4099ae39cf6641 Message-Id: User-Agent: Mercurial-patchbomb/1.3 Date: Wed, 23 Sep 2009 02:21:57 -0000 From: Peter Williams To: Ingo Molnar Cc: Peter Zijlstra , Mike Galbraith , Linux Kernel Mailing X-Authentication-Info: Submitted using SMTP AUTH PLAIN at nskntotgx01p.mx.bigpond.com from [124.185.86.236] using ID pwil3058@bigpond.net.au at Wed, 23 Sep 2009 02:21:58 +0000 X-RPD-ScanID: Class unknown; VirusThreatLevel unknown, RefID str=0001.0A150203.4AB98647.006A,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 982 Lines: 27 >From the code in rt_mutex_setprio(), it is evident that the intention is that task's with a RT 'prio' value as a consequence of receiving a PI boost also have their 'sched_class' field set to '&rt_sched_class'. However, the code in __setscheduler() could result in this intention being frustrated. This patch fixes this problem. Signed-off-by: Peter Williams diff --git a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c +++ b/kernel/sched.c @@ -6159,6 +6159,8 @@ __setscheduler(struct rq *rq, struct tas p->normal_prio = normal_prio(p); /* we are holding p->pi_lock already */ p->prio = rt_mutex_getprio(p); + if (rt_prio(p->prio)) + p->sched_class = &rt_sched_class; set_load_weight(p); } -- 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/