Linus Torvalds writes: (Summary)
I also wonder if we could be even *more* hacky, and in the whole
__migration_entry_wait() path, change the logic from:
__migration_entry_wait() path, change the logic from:
- wait on page lock before retrying the fault
- wait on page lock before retrying the fault
to
to
- yield()
- yield()
which is hacky, but there's a rationale for it:
which is hacky, but there's a rationale for it:
(a) avoid the crazy long wait queues ;)
(a) avoid the crazy long wait queues ;)
(b) we know that migration is *supposed* to be CPU-bound (not IO bound), so yielding the CPU and retrying may just be the right thing to do.
to do.
It's possible that we could just do a hybrid approach, and introduce a "wait_on_page_lock_or_yield()", that does a sleeping wait if the wait-queue is short, and a yield otherwise, but it might be worth just testing the truly stupid patch.
testing the truly stupid patch.
Because that code sequence doesn't actually depend on "wait_
- wait on page lock before retrying the fault
to
to
- yield()
- yield()
which is hacky, but there's a rationale for it:
which is hacky, but there's a rationale for it:
(a) avoid the crazy long wait queues ;)
(a) avoid the crazy long wait queues ;)
(b) we know that migration is *supposed* to be CPU-bound (not IO bound), so yielding the CPU and retrying may just be the right thing to do.
to do.
It's possible that we could just do a hybrid approach, and introduce a "wait_on_page_lock_or_yield()", that does a sleeping wait if the wait-queue is short, and a yield otherwise, but it might be worth just testing the truly stupid patch.
testing the truly stupid patch.
Because that code sequence doesn't actually depend on "wait_