page_reclaim_mem() gives up on reclaiming memory too easily
While debugging an out of memory issue (unable to create shared memory segment due to large segspt_minfree) we found that page_reclaim_mem() was triggering the ARC kmem cache hdr_recl() code, but the ARC wasn't quite freeing memory quickly enough for the page_reclaim_mem() call, so the ARC lost some cached pages AND the shmat() memory allocation failed. We should make the page_reclaim_mem() code try a little bit harder before giving up.
This makes page_reclaim_mem() give up after it's failed to reclaim any memory three times in a row, rather than failing if no memory is freed after the first pass. (This might not happen because all the reclaiming occurs asynchronously.)
Updated by Electric Monk almost 6 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 9424a8dfe0a200274497dbfbbc8d8e53bfc38ac7 Author: Dan Kimmel <email@example.com> Date: 2016-09-07T22:39:44.000Z 7241 page_reclaim_mem() gives up on reclaiming memory too easily Reviewed by: Matthew Ahrens <firstname.lastname@example.org> Reviewed by: Paul Dagnelie <email@example.com> Reviewed by: Prashanth Sreenivasa <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>