RE: 2.4.10 still slow compared to 2.4.5pre1

DICKENS,CARY (cary_dickens2@hp.com)
Tue, 25 Sep 2001 20:44:35 -0400


> -----Original Message-----
> From: Andrea Arcangeli [mailto:andrea@suse.de]
> Sent: Tuesday, September 25, 2001 3:57 PM
> To: DICKENS,CARY (HP-Loveland,ex2)
> Cc: 'linux-kernel@vger.kernel.org'; HABBINGA,ERIK (HP-Loveland,ex1)
> Subject: Re: 2.4.10 still slow compared to 2.4.5pre1
>
>
> On Tue, Sep 25, 2001 at 05:22:41PM -0400, DICKENS,CARY
> (HP-Loveland,ex2) wrote:
> > We tried the 00_vmtweaks patch from Andrea and it failed to
> boot. There was
> > an issue starting kswapd and the kernel would oops.
>
> You did something wrong then, please try it again.
>
> Andrea
>
Andrea,

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/