<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [i855GM, 3.18] X getting stuck in congestion_wait for shrinker"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=88026#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [i855GM, 3.18] X getting stuck in congestion_wait for shrinker"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=88026">bug 88026</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>Fwiw:

shrink_inactive_list():
/*
 * If kswapd scans pages marked marked for immediate
 * reclaim and under writeback (nr_immediate), it implies
 * that pages are cycling through the LRU faster than
 * they are written so also forcibly stall.
 */
 if (nr_immediate && current_may_throttle())
   congestion_wait(BLK_RW_ASYNC, HZ/10);

nr_immediate is set in shrink_page_list():
if (PageWriteback(page)) {
  if (current_is_kswapd() &&
      PageReclaim(page) &&
      test_bit(ZONE_WRITEBACK, &zone->flags)) {
      nr_immediate++;
      goto keep_locked;
   }
}

which is obviously not true for Xorg.


There is one other call to congestion_wait() at the start of
shrink_inactive_list() (might be worth using gdb to confirm which callsite is
the blocker):

while (unlikely(too_many_isolated(zone, file, sc)))
   congestion_wait(BLK_RW_ASYNC, HZ/10);

too_many_isolated() is basically NR_ISOLATED_ANON > NR_INACTIVE_ANON and if
there is actually no backingdev activity then congestion_wait() will not make
any forward progress and it will just loop.

Maybe (though it seems to contradict the intentions of all the comments):

diff --git a/mm/vmscan.c b/mm/vmscan.c
index bd9a72bc4a1b..79a4e9379381 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1488,11 +1488,14 @@ shrink_inactive_list(unsigned long nr_to_scan, struct
lruvec *lruvec,
        struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;

        while (unlikely(too_many_isolated(zone, file, sc))) {
-               congestion_wait(BLK_RW_ASYNC, HZ/10);
+               long rem = congestion_wait(BLK_RW_ASYNC, HZ/10);

                /* We are about to die and free our memory. Return now. */
                if (fatal_signal_pending(current))
                        return SWAP_CLUSTER_MAX;
+
+               if (rem == 0)
+                       break;
        }

        lru_add_drain();</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>