From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031147AbbEEUU5 (ORCPT ); Tue, 5 May 2015 16:20:57 -0400 Received: from smtprelay0237.hostedemail.com ([216.40.44.237]:34696 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031127AbbEEUUt (ORCPT ); Tue, 5 May 2015 16:20:49 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:69:146:355:379:541:599:800:960:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2198:2199:2282:2380:2393:2525:2553:2560:2563:2682:2685:2859:2890:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4042:4250:4321:4401:4559:4605:5007:6261:7514:7875:7903:8599:8660:9025:9163:10004:10400:10848:10967:11026:11232:11658:11914:12043:12198:12438:12517:12519:12555:12740:12783:13141:13148:13180:13229:13230:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: geese19_23aeeff044c53 X-Filterd-Recvd-Size: 4404 Date: Tue, 5 May 2015 16:20:43 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Mike Galbraith , Ronny Meeus , LKML , Peter Zijlstra Subject: Re: [PATCH V2] sched: Handle priority boosted tasks proper in setscheduler() Message-ID: <20150505162043.2b075129@gandalf.local.home> In-Reply-To: References: <20150505122920.7861907d@gandalf.local.home> <20150505124244.1f154dc9@gandalf.local.home> <20150505130149.44d2cc80@gandalf.local.home> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 May 2015 19:49:49 +0200 (CEST) Thomas Gleixner wrote: > Ronny reported that the following scenario is not handled correctly: > > T1 (prio = 10) > lock(rtmutex); > > T2 (prio = 20) > lock(rtmutex) > boost T1 > > T1 (prio = 20) > sys_set_scheduler(prio = 30) > T1 prio = 30 > .... > sys_set_scheduler(prio = 10) > T1 prio = 30 > > The last step is wrong as T1 should now be back at prio 20. > > commit c365c292d0590 "sched: Consider pi boosting in setscheduler()" > only handles the case where a boosted tasks tries to lower its > priority. > > Fix it by taking the new effective priority into account for the > decision whether a change of the priority is required. > > Reported-by: Ronny Meeus > Fixes: commit c365c292d0590 "sched: Consider pi boosting in setscheduler()" > Signed-off-by: Thomas Gleixner > Cc: Mike Galbraith > Cc: Peter Zijlstra > Cc: Steven Rostedt > Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1505051806060.4225@nanos > Signed-off-by: Thomas Gleixner Reviewed-by: Steven Rostedt Tested-by: Steven Rostedt Note, this should be marked stable. I can get a nasty kernel spat with playing around with RT priorities without this patch. [ 42.226836] ------------[ cut here ]------------ [ 42.227495] WARNING: CPU: 0 PID: 2271 at /home/rostedt/work/git/linux-trace.git/kernel/sched/rt.c:1114 dequeue_rt_stack+0x220/0x22b() [ 42.227495] Modules linked in: [..] [ 42.227495] CPU: 0 PID: 2271 Comm: check_pi_deboos Not tainted 4.1.0-rc1-test+ #415 [ 42.227495] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS SDBLI944.86P 05/08/2007 [ 42.227495] 0000000000000009 ffff880078a5fd28 ffffffff815fcc4c 0000000080000002 [ 42.227495] 0000000000000000 ffff880078a5fd68 ffffffff810496ea 0000000000000000 [ 42.227495] ffffffff81075d5a ffff88007669e208 ffff88007d416460 0000000000000054 [ 42.227495] Call Trace: [ 42.227495] [] dump_stack+0x4f/0x7b [ 42.227495] [] warn_slowpath_common+0xa1/0xbb [ 42.227495] [] ? dequeue_rt_stack+0x220/0x22b [ 42.227495] [] warn_slowpath_null+0x1a/0x1c [ 42.227495] [] dequeue_rt_stack+0x220/0x22b [ 42.227495] [] dequeue_rt_entity+0x1f/0x58 [ 42.227495] [] dequeue_task_rt+0x24/0x34 [ 42.227495] [] dequeue_task+0x69/0x70 [ 42.227495] [] sched_move_task+0x4e/0xdb [ 42.227495] [] cpu_cgroup_exit+0x17/0x19 [ 42.227495] [] cgroup_exit+0x9f/0xbe [ 42.227495] [] do_exit+0x429/0x92f [ 42.227495] [] SyS_exit+0x17/0x17 [ 42.227495] [] system_call_fastpath+0x12/0x6a [ 42.227495] ---[ end trace 14460ffaa77bf181 ]--- [ 42.412352] ------------[ cut here ]------------ -- Steve