Linus Torvalds writes: (Summary)
We actually have a special rule to make it *not* be fair, in that
interrupts are allowed to take the read lock if there are readers - even if
there are waiting writers.
there are waiting writers.
I'm not sure how much of an fairness effect this has, but it's required because of our rule that you can take it for reading without disabling interrupts.
interrupts.
See
See
void queued_read_lock_slowpath(struct qrwlock *lock) void queued_read_lock_slowpath(struct qrwlock *lock) in kernel/locking/qrwlock.c.
in kernel/locking/qrwlock.c.
there are waiting writers.
I'm not sure how much of an fairness effect this has, but it's required because of our rule that you can take it for reading without disabling interrupts.
interrupts.
See
See
void queued_read_lock_slowpath(struct qrwlock *lock) void queued_read_lock_slowpath(struct qrwlock *lock) in kernel/locking/qrwlock.c.
in kernel/locking/qrwlock.c.
[...]
You basically want to spin-wait with interrupts enabled, right?