Re: [PATCH] x86: mtrr cleanup for converting continuous to discrete- auto detect v2

From: H. Peter Anvin
Date: Thu May 01 2008 - 17:49:52 EST


Yinghai Lu wrote:

That's not the point. I understand you want to flatten the layout. The
point is: why do you need manual tunables for the algorithm to do the right
thing?

optimal result is not losing covering for ranges that is originally
covered, and still keep as many of spare mtrr entries for X server
driver.
we only have 8 mtrrs, could lose some covering because of run out of mtrr regs.
So we need to search it according to chunk/gran with ram ranges that
is defined by old mtrr layout.

Yes. You have a search space of less than 1000 possible combinations (64..20 bits), so it hardly is any reason to not search the entire universe of possibilities, even if by exhaustive search.

Now, if even that searching can't come up with the optimal solution (if one exists) in all cases, then the algorithm is broken.

and if we can not find the optimal setting, user could select one
setting (chunk/gran size) to boot next time, but he will lose some
covering.
for some regions. later trim_mtrr will remove those range from e820 map

Right, now we're talking policy, which obviously has to be entered by the user.

-hpa

--
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/