On (25/02/20 08:09), Masami Hiramatsu wrote:
So something like this?I totally like this and always wanted to have something simlar,
unsigned int block_flags;
union {
struct mutex *mutex;
struct rwsem +rwsem;
struct rtmutex *rtmutex;
} blocked_on;
enum {
BLOCKED_ON_MUTEX;
BLOCKED_ON_RWSEM;
BLOCKED_ON_RTMUTEX;
BLOCKED_ON_IO;
} block_reason;
something for all "sleepable" synchronization primitives, lightweight
enough (memory and CPU usage wise) to run on consumer devices. I was
thinking of a rhashtable where each entry represents "sleepable"
primitive with a "owner" pointer and a list of "blocked on" tasks.
But I'm sure you'll have a better idea.
If I may add a couple of "wishes", can we also add:
- completions (so that things like wait_for_completion and
synchronize srcu get covered)
- wait on bit (so that things like lock_buffer and so on get covered)