Both the book "Operating System Principles" by Silberschatz/Galvin (9th Edition), as well as the article on Wikipedia on priority inversion say that in priority inversion, a high priority process can't use a resource held by a low priority process as a medium priority process preempts the low priority process and gets that resource. But if so (i.e., if priority-based preemption is allowed) why can't the high priority process preempt the lower priority process itself and get the resource?
Below is what is mentioned in the book as well as the Wikipedia article:
Consider two tasks H and L, of high and low priority respectively, either of which can acquire exclusive use of a shared resource R. If H attempts to acquire R after L has acquired it, then H becomes blocked until L relinquishes the resource. Sharing an exclusive-use resource (R in this case) in a well-designed system typically involves L relinquishing R promptly so that H (a higher priority task) does not stay blocked for excessive periods of time. Despite good design, however, it is possible that a third task M of medium priority (p(L) < p(M) < p(H), where p(x) represents the priority for task (x)) becomes runnable during L's use of R. At this point, M being higher in priority than L, preempts L, causing L to not be able to relinquish R promptly, in turn causing H—the highest priority process—to be unable to run. This is called priority inversion where a higher priority task is preempted by a lower priority one.