From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512AbcFNSXC (ORCPT ); Tue, 14 Jun 2016 14:23:02 -0400 Received: from smtprelay0021.hostedemail.com ([216.40.44.21]:38484 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932457AbcFNSW7 (ORCPT ); Tue, 14 Jun 2016 14:22:59 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6261:7576:7875:9025:9391:10004:10400:10848:10913:10967:11026:11232:11658:11914:12043:12198:12438:12517:12519:12555:12740:12783:13069:13311:13357:13439:13846:14181:14659:14721:21080:21324:21394:21433,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,LFtime:4,LUA_SUMMARY:none X-HE-Tag: wax37_53bc963c88624 X-Filterd-Recvd-Size: 2819 Date: Tue, 14 Jun 2016 14:22:54 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: mingo@kernel.org, tglx@linutronix.de, juri.lelli@arm.com, xlpang@redhat.com, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, bristot@redhat.com, Ingo Molnar Subject: Re: [RFC][PATCH 1/8] rtmutex: Deboost before waking up the top waiter Message-ID: <20160614142254.76f5abd2@grimm.local.home> In-Reply-To: <20160607200215.637804442@infradead.org> References: <20160607195635.710022345@infradead.org> <20160607200215.637804442@infradead.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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, 07 Jun 2016 21:56:36 +0200 Peter Zijlstra wrote: > From: Xunlei Pang > > We should deboost before waking the high-prio task, such that > we don't run two tasks with the same "state"(priority, deadline, > sched_class, etc) during the period between the end of wake_up_q() > and the end of rt_mutex_adjust_prio(). > > As "Peter Zijlstra" said: > Its semantically icky to have the two tasks running off the same > state and practically icky when you consider bandwidth inheritance -- > where the boosted task wants to explicitly modify the state of the > booster. In that latter case you really want to unboost before you > let the booster run again. > > But this however can lead to prio-inversion if current would get > preempted after the deboost but before waking our high-prio task, > hence we disable preemption before doing deboost, and enabling it > after the wake up is over. > > The patch fixed the logic, and introduced rt_mutex_postunlock() > to do some code refactor. > > Most importantly however; this change ensures pointer stability for > the next patch, where we have rt_mutex_setprio() cache a pointer to > the top-most waiter task. If we, as before this change, do the wakeup > first and then deboost, this pointer might point into thin air. > > Cc: Steven Rostedt Acked-by: Steven Rostedt -- Steve > Cc: Ingo Molnar > Cc: Juri Lelli > Suggested-by: Peter Zijlstra > [peterz: Changelog] > Signed-off-by: Xunlei Pang > Signed-off-by: Peter Zijlstra (Intel) > Link: http://lkml.kernel.org/r/1461659449-19497-1-git-send-email-xlpang@redhat.com > ---