Looking through the ARC back pressure code I see a scenario when I think ARC may not shrink as fast as it could:
- arc_size < arc_c and arc_adjust() does not evict anything, returning zero to arc_reclaim_thread();
- arc_available_memory() reports memory pressure, which can not be satisfied by arc_kmem_reap_now();
- arc_shrink() reduces arc_c and calls arc_adjust(), return of which is ignored;
- even if the last arc_adjust() could not satisfy arc_size < arc_c, arc_reclaim_thread() will still go to sleep, since the first one returned zero().
This patch supposed to cover that case.
Can anybody see any flaw in my logic?