diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2008-09-24 08:53:33 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 19:29:18 +0200 |
commit | 9542ada803198e6eba29d3289abb39ea82047b92 (patch) | |
tree | 3a99406988d1e8643b91840614cfd3340408a42f /arch/x86/mm/ioremap.c | |
parent | ad5ca55f6bdb47c957b681c7358bb3719ba4ee82 (diff) | |
download | op-kernel-dev-9542ada803198e6eba29d3289abb39ea82047b92.zip op-kernel-dev-9542ada803198e6eba29d3289abb39ea82047b92.tar.gz |
x86: track memtype for RAM in page struct
Track the memtype for RAM pages in page struct instead of using the
memtype list. This avoids the explosion in the number of entries in
memtype list (of the order of 20,000 with AGP) and makes the PAT
tracking simpler.
We are using PG_arch_1 bit in page->flags.
We still use the memtype list for non RAM pages.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/ioremap.c')
-rw-r--r-- | arch/x86/mm/ioremap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index d4b6e6a..d03c461 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -83,6 +83,25 @@ int page_is_ram(unsigned long pagenr) return 0; } +int pagerange_is_ram(unsigned long start, unsigned long end) +{ + int ram_page = 0, not_rampage = 0; + unsigned long page_nr; + + for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT); + ++page_nr) { + if (page_is_ram(page_nr)) + ram_page = 1; + else + not_rampage = 1; + + if (ram_page == not_rampage) + return -1; + } + + return ram_page; +} + /* * Fix up the linear direct mapping of the kernel to avoid cache attribute * conflicts. |