Re: [PATCH 4/7] ppc64 - Specify amount of kernel memory at boottime

From: Dave Hansen
Date: Tue Feb 21 2006 - 12:33:52 EST


On Tue, 2006-02-21 at 14:51 +0000, Mel Gorman wrote:
> A new release of patches is a long time away but here is an early draft of
> what the above currently looks like. Is this more or less what you were
> thinking?

I think it may be a bit harder to understand than even the other
one. :(

In a nutshell, get_zones_info() tries to do too much. Six function
arguments should be a big, red, warning light that something is really
wrong. Calling a function _info() is another bad sign. It means that
you can't discretely describe what it does.

Remember, there are 3 distinct tasks here:

1. size the node information from init_node_data[]
2. size the easy reclaim zone based on the boot parameters
3. take holes into account when doing the reclaim zone sizing

You don't have to do all of those tasks in one pass. This is not a
performance-critical path, so try to be as clear as possible, even if it
means an extra run or two through the data.

Maybe something like this?

ZONE_DMA = all memory in node
if (kernelcore was set)
while (zone size with holes of ZONE_DMA > kernelcore)
move memory into EASYRCLM
zholes[DMA] = ...
zholes[EASYRCLM] = ...
free_area_init_node()

Those are all operations I can understand.

-- Dave

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