Linus Torvalds writes: (Summary)
Even the add_page_wait_queue() thing, which looks oh-so-generic,
really only waits on PG_locked.
really only waits on PG_locked.
And the PG_writeback case never really cares for the "locked" case, so this incredibly generic interface that allows you to wait on any bit you want, and has the whole exclusive wait support for getting exclusive access to the bit really only has three cases: exclusive access to the bit really only has three cases: - wait for locked exclusive (wake up first waiter when unlocked) - wait for locked exclusive (wake up first waiter when unlocked) - wait for locked (wake up all waiters when unlocked) - wait for locked (wake up all waiters when unlocked) - wait for writeback (wake up all waiters when no longer under writeback) - wait for writeback (wake up all waiters when no longer under writeback) and those last two could probably even share the same queue.
really only waits on PG_locked.
And the PG_writeback case never really cares for the "locked" case, so this incredibly generic interface that allows you to wait on any bit you want, and has the whole exclusive wait support for getting exclusive access to the bit really only has three cases: exclusive access to the bit really only has three cases: - wait for locked exclusive (wake up first waiter when unlocked) - wait for locked exclusive (wake up first waiter when unlocked) - wait for locked (wake up all waiters when unlocked) - wait for locked (wake up all waiters when unlocked) - wait for writeback (wake up all waiters when no longer under writeback) - wait for writeback (wake up all waiters when no longer under writeback) and those last two could probably even share the same queue.