...if it's possible to do that for your application! It isn't always, if what lock you need next depends on the value of a previously locked value.
I think there are some applications and algorithms that we just don't know a way to create an ordering for realistically fine-grained locks.
For example airline seat reservation. Someone clicking on seats to reserve them. You can't apply locks in a total order because... you can't read the person's mind on what seat they're going to click next.
Or Lee's algorithm.
(I wrote the first half a PhD on this.)
https://chrisseaton.com/research-symposium-2012/seaton-irreg...
Multithreading with semaphores/locks is about as dirty as it can get.