Re: Priority Ceiling for SMP?
From: Thomas Gleixner <hidden>
Date: 2007-11-14 16:39:11
On Thu, 8 Nov 2007, Bernhard Kuhn wrote:
Luís Henriques wrote:quoted
Maybe I didn't completely understood your question, but... if there is a problem with SMP efficiency (I do not really know, but believe you :) ) with priority ceiling (PC) implementation, this problem should have been already identified (and possibly solved) in the current PI implementation, right?To make it clear: I'm not aware of any efficiency issues with the current PI implementation :-) The (potential) efficiency issue with PC on SMP derives from the dead-lock avoidance mechanism that you mentioned: If a task locks a resource, then it's priority is raised to the ceiling (which is typically the highest priority of all task sharing that resource). Once that happens, no other task (sharing the same resource) could then lock another resource that potentially leads to a dead-lock situation. Example: * A low priority Task A shall share resources X and Y with a high priority Task B. * Task A shall execute the following fraction of code: 1. lock(X) 2. lock(Y) * Task B shall execute the following fraction of code: 1. lock(Y) 2. lock(X)
Classic ABBA deadlock :) Priority ceiling is not designed to allow that. It's just a coincidence that it does not lead to a deadlock on UP, but thats not a semantical property. Thanks, tglx