Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756333AbZCLOta (ORCPT ); Thu, 12 Mar 2009 10:49:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755115AbZCLOtT (ORCPT ); Thu, 12 Mar 2009 10:49:19 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:43799 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbZCLOtT (ORCPT ); Thu, 12 Mar 2009 10:49:19 -0400 Subject: Re: [tip:core/futexes] futex: use current->time_slack_ns for rt tasks too From: Peter Zijlstra To: Thomas Gleixner Cc: Arjan van de Ven , mingo@redhat.com, hpa@zytor.com, dvhltc@us.ibm.com, linux-kernel@vger.kernel.org, rusty@rustcorp.com.au, mingo@elte.hu, linux-tip-commits@vger.kernel.org In-Reply-To: References: <20090312075559.9856.28822.stgit@Aeon> <49B913DC.6040807@linux.intel.com> <1236866529.22914.3694.camel@twins> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 12 Mar 2009 15:48:34 +0100 Message-Id: <1236869314.22914.3697.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1844 Lines: 65 > > --- > > > > Subject: sched: adjust timer_slack_ns on scheduler policy change > > From: Peter Zijlstra > > Date: Thu Mar 12 15:01:02 CET 2009 > > > > Ensure RT tasks have 0 timer slack. > > > > Signed-off-by: Peter Zijlstra > > --- > > kernel/sched.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > Index: linux-2.6/kernel/sched.c > > =================================================================== > > --- linux-2.6.orig/kernel/sched.c > > +++ linux-2.6/kernel/sched.c > > @@ -5511,10 +5511,12 @@ __setscheduler(struct rq *rq, struct tas > > case SCHED_NORMAL: > > case SCHED_BATCH: > > case SCHED_IDLE: > > + p->timer_slack_ns = p->default_timer_slack_ns; > > p->sched_class = &fair_sched_class; > > break; > > case SCHED_FIFO: > > case SCHED_RR: > > + p->timer_slack_ns = 0; > > p->sched_class = &rt_sched_class; > > break; > > } > > Looking at the default_timer_slack_ns stuff, do we want something like the below? --- diff --git a/kernel/sys.c b/kernel/sys.c index 7306f94..6d8a84d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1811,11 +1811,13 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = current->timer_slack_ns; break; case PR_SET_TIMERSLACK: - if (arg2 <= 0) + if (arg2 <= 0) { current->timer_slack_ns = current->default_timer_slack_ns; - else - current->timer_slack_ns = arg2; + } else { + current->default_timer_slack_ns = + current->timer_slack_ns = arg2; + } error = 0; break; default: -- 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/