Another bug is that if try_to_free_pages / balance_pgdat are called with a gfp_mask specifying GFP_IO and/or GFP_FS, they may reclaim the requisite number of pages, and reset prev_priority to DEF_PRIORITY. However, another reclaimer without those gfp_mask flags set may still be struggling to reclaim pages. The easy fix for this is to key the distress calculation not off zone->prev_priority, but also take into account the local caller's priority by using: min(zone->prev_priority, sc->priority) Signed-off-by: Martin J. Bligh