From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760156AbcINHmA (ORCPT ); Wed, 14 Sep 2016 03:42:00 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47734 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755424AbcINHl5 (ORCPT ); Wed, 14 Sep 2016 03:41:57 -0400 Date: Wed, 14 Sep 2016 09:41:52 +0200 From: Peter Zijlstra To: Arve =?iso-8859-1?B?SGr4bm5lduVn?= Cc: Greg Kroah-Hartman , Thomas Gleixner , "devel@driverdev.osuosl.org" , Riley Andrews , LKML , Christoph Hellwig , Todd Kjos Subject: Re: [PATCH] android: binder: Disable preemption while holding the global binder lock Message-ID: <20160914074152.GC5020@twins.programming.kicks-ass.net> References: <20160910161659.GA7987@infradead.org> <20160910162210.GK10153@twins.programming.kicks-ass.net> <20160910172843.GA17876@kroah.com> <20160913073259.GC5008@twins.programming.kicks-ass.net> <20160914071001.GI5008@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160914071001.GI5008@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2016 at 09:10:01AM +0200, Peter Zijlstra wrote: > We could define a meaningful something for CFS and implement that, but > it isn't currently done. So the generalization of the Priority Inheritance Protocol is Proxy Execution Protocol, which basically lets the boosted task run _as_ the task on the block chain as picked by the schedule function (treating all of them as runnable). Where 'as' means it really consumes scheduling resources of the (blocked) donor task. Since the scheduling function for FIFO is: pick the highest prio one and go for it, this trivially reduces to PI for FIFO. Now, Proxy Execution Protocol is 'trivial' to implement on UP, but has a few wobbles on SMP. But we can use it to define a sensible definition for a WFQ class scheduler (like CFS). For these the scheduling function basically runs the boosted task as every donor task on the block chain gets their slice. Alternatively, since it treats all 'blocked' tasks as runnable, the total weight of the boosted task is its own weight plus the sum of weight on the block chain. Which is something that shouldn't be too hard to implement, but very much isn't what happens today.