Matthew Wilcox <matthew@xxxxxx> writes: > > The blocked_list is a bit more complex since we need to check every lock > on the blocked list, and would need to acquire all the sb_file_lock_locks > to check this list consistently. I don't see a nice way to do this -- > particularly when you consider that we need to run this check every time > someone takes out a POSIX lock that blocks on another lock. Have you considered using a timeout approach? e.g. just start a timer when aquiring the lock and when you can't get it in some short (user configurable) time and only do then the expensive deadlock check. Timers are quite optimized and have per cpu state so they should be cheap enough. AFAIK that's a standard technique used in databases. Advantage is that it keeps all that out of the fast path. Disadvantage is that it takes at least timeout time to detect a deadlock, but they should be infrequent anyways I guess so it's hopefully not a problem (and if it was the user could reset the timeout to 0) -Andi - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html