+ if (m->list_req_pending) {
+ /*
+ * "list_req_pending" means that the
+ * page has been marked for a page-in
+ * or page-out operation but hasn't been
+ * grabbed yet.
+ * Since whoever marked it
+ * "list_req_pending" might now be
+ * making its way through other layers
+ * of code and possibly blocked on locks
+ * that we might be holding, we can't
+ * just block on a "busy" and
+ * "list_req_pending" page or we might
+ * deadlock with that other thread.
+ *
+ * [ For pages backed by a file on an
+ * HFS volume, we might deadlock with
+ * the HFS truncate lock, for example:
+ * A: starts a pageout or pagein
+ * operation and marks a page "busy",
+ * "list_req_pending" and either
+ * "pageout", "cleaning" or "absent".
+ * A: makes its way through the
+ * memory object (vnode) code.
+ * B: starts from the memory object
+ * side, via a write() on a file, for
+ * example.
+ * B: grabs some filesystem locks.
+ * B: attempts to grab the same page for
+ * its I/O.
+ * B: blocks here because the page is
+ * "busy".
+ * A: attempts to grab the filesystem
+ * lock we're holding.
+ * And we have a deadlock... ]
+ *
+ * Since the page hasn't been claimed
+ * by the other thread yet, it's fair
+ * for us to grab here.
+ */
+ if (m->absent) {
+ /*
+ * The page needs to be paged
+ * in. We can do it here but we
+ * need to get rid of "m", the
+ * place holder page inserted by
+ * another thread who is also
+ * trying to page it in. When
+ * that thread resumes, it will
+ * either wait for our page to
+ * arrive or it will find it
+ * already there.
+ */
+ VM_PAGE_FREE(m);