[PATCH] x86: have set_memory_array_{uc,wb} coalesce memtypes.

From: Rene Herman
Date: Thu Aug 21 2008 - 19:01:22 EST


This is a multi-part message in MIME format.On 21-08-08 19:15, Rene Herman wrote:

On 21-08-08 14:06, Ingo Molnar wrote:

Would be nice to test tip/master - it has both that patch included and the latest pageattr-array API (with enablement in AGP drivers) patchset, done by Shaohua Li, based on Dave's original patch.

That patch by itself doesn't help any -- the new set_memory_array_uc() still calls reserve_memtype() for each single page in the array. To help, it needs to coalesce adjacent entries, which is itself easy to do were it not for the need to keep the list of reserved (base,end) pairs around for free_memtype() time (and halfway fail time).

Actually, might as well simply reconstruct the memtype list at free time I guess. How is this for a coalescing version of the array functions?

NOTE: I am posting this because I'm going to bed but haven't stared comfortably long at this and might be buggy. Compiles, boots and provides me with:

root@7ixe4:~# wc -l /debug/x86/pat_memtype_list
53 /debug/x86/pat_memtype_list

otherwise (down from 16384+).

<snore>

Rene.