Re: [PATCH] slabasap-mm5_A2

Ed Tomlinson
2002-09-09T22:28:18Z

On September 9, 2002 06:07 pm, Andrew Morton wrote:
> Ed Tomlinson wrote:
> > Hi Andrew,
> >
> > Found three oops when checking this afternoon's log. Looks like
> > *total_scanned can be zero...
> >
> > how about;
> >
> > ratio = pages > *total_scanned ? pages / (*total_scanned | 1) : 1;
>
> Yup, thanks. I went the "+ 1" route ;)

I used the above to catch two situations. One was if

to_reclaim = zone->pages_high - zone->free_pages;
if (to_reclaim < 0)
continue; /* zone has enough memory */

triggered an left *total_scanned zero, and second if to catch the case
when pages > *total_scanned. Think both might happen. In the oops,
think *total_scanned was zero.

Ed