Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbcDRIZH (ORCPT ); Mon, 18 Apr 2016 04:25:07 -0400 Received: from www.linutronix.de ([62.245.132.108]:33449 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbcDRIZF (ORCPT ); Mon, 18 Apr 2016 04:25:05 -0400 Date: Mon, 18 Apr 2016 10:23:33 +0200 (CEST) From: Thomas Gleixner To: Xunlei Pang cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Juri Lelli , Ingo Molnar , Steven Rostedt Subject: Re: [PATCH v3 1/6] rtmutex: Deboost before waking up the top waiter In-Reply-To: <1460633827-345-2-git-send-email-xlpang@redhat.com> Message-ID: References: <1460633827-345-1-git-send-email-xlpang@redhat.com> <1460633827-345-2-git-send-email-xlpang@redhat.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 464 Lines: 28 On Thu, 14 Apr 2016, Xunlei Pang wrote: > We should deboost before waking the high-prio task such that > we don't run two tasks with the 'same' priority. No. This is fundamentaly broken. T1 (prio 0) lock(X) --> preemption T2 (prio 10) lock(X) boost(T1) schedule() T1 (prio 10) unlock(X) deboost() (prio 0) --> preemption T3 (prio 5) .... Classic priority inversion enabled by a mechanism to avoid it. Brilliant stuff. Thanks, tglx