I hate to inform you that we tracked this down and nr_inactive_pages can be
zero. This causes divide by zero in shrink_caches.
This is from the 00_vm-tweaks-1 patch:
static int shrink_caches(int priority, zone_t * classzone, unsigned int
gfp_mask, int nr_pages)
{
- int max_scan = nr_inactive_pages / priority;
+ int max_scan;
+ int chunk_size = nr_pages;
+ unsigned long ratio;
nr_pages -= kmem_cache_reap(gfp_mask);
if (nr_pages <= 0)
return 0;
- /* Do we want to age the active list? */
- if (nr_inactive_pages < nr_active_pages*2)
- refill_inactive(nr_pages);
+ spin_lock(&pagemap_lru_lock);
+ nr_pages = chunk_size;
+ /* try to keep the active list 2/3 of the size of the cache */
+ ratio = (unsigned long) nr_pages * nr_active_pages /
(nr_inactive_pages * 2);
^^^^^^^^^^^^^^^^^^^^^^
+ refill_inactive(ratio);
+ max_scan = nr_inactive_pages / priority;
nr_pages = shrink_cache(nr_pages, max_scan, classzone, gfp_mask);
if (nr_pages <= 0)
return 0;
Hope this helps,
Cary
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/