Re: [PATCH 4/5] mm improvements

Nick Piggin
2004-02-04T10:19:36Z

Andrew Morton wrote:

>Nick Piggin <piggin@cyberone.com.au> wrote:
>
>>+ if (zone->nr_active >= zone->nr_inactive*4)
>> + /* ratio will be >= 2 */
>> + imbalance = 8*nr_pages;
>> + else if (zone->nr_active >= zone->nr_inactive*2)
>> + /* 1 < ratio < 2 */
>> + imbalance = 4*nr_pages*zone->nr_active / (zone->nr_inactive*2);
>>
>
>This can cause a divide-by-zero, yes?
>
>

Yes. Sorry. I guess just adding 1 to the divisor should be fine.