Re: [RFC] [RFT] [PATCH] memory zone balancing

Andrea Arcangeli (andrea@suse.de)
Mon, 27 Dec 1999 17:06:55 +0100 (CET)


On Wed, 15 Dec 1999, Kanoj Sarcar wrote:

>- if ((gfp_mask & __GFP_DMA) && !PageDMA(page_map))
>- goto check_table;
>- if (!(gfp_mask & __GFP_HIGHMEM) && PageHighMem(page_map))
>+ if (zone && (page_map->zone != zone))
> goto check_table;
> swap_attempts++;

> /* don't account passes over not DMA pages */
>- if ((gfp_mask & __GFP_DMA) && !PageDMA(page))
>- goto dispose_continue;
>- if (!(gfp_mask & __GFP_HIGHMEM) && PageHighMem(page))
>+ if (zone && (page->zone != zone))
> goto dispose_continue;

> if (PageReserved(page)
> || PageLocked(page)
>- || ((gfp_mask & __GFP_DMA) && !PageDMA(page))
>- || (!(gfp_mask & __GFP_HIGHMEM) && PageHighMem(page)))
>+ || (zone && (page->zone != zone)))
> goto out_failed;

The above changes you proposed will cause you to go oom even if you still
have 16mbyte of pure (ISA-DMA) RAM free in a no-bigmem kernel. With a
bigmem kernel you'll go OOM even if you still have 1giga of memory free.

As I just told you privately in previous email the checks should be a kind
of ">" (or a more complex operation implemented in a function) and not a
"!=".

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/