On Thu, May 08, 2008 at 04:54:44PM -0700, H. Peter Anvin wrote:What I meant was: MTRRs are not really base and size. They are defined as base and mask. Any addr is affected by mtrr if addr & mask == base & mask. So, MTRR entry like base = 0xf00000, mask = 0xff00000 with 36 bit physical address covers 0xf00000-0xffffff, 0x10f00000-0x10ffffff, 0x20f00000-0x20ffffff, .... In this case if user is trying to mmap 0x1a000000-0x2a000000, we cannot really cover this case with single parsing of variable address ranges. We will have to go through the sub-ranges withing single variable range, which can be page by page in worst case. Agree that is has to be called a heuristic. Yes. Not having that will work may be not as optimially. Having it gives us better starting point when we start to find a proper memory type for requests, especially when there are no other overlapping mappings in PAT list. One of the reason for heristic was to get proper type for /dev/mem maps for WB region (ACPI and BIOS area). /dev/mem checks to see the mtrr type of the start address and starts with that type for the request. As long as there are no other conflict in PAT list, we can give WB to this /dev/mem request. Not having this heuristic we will have to most probably default to UC. When there are overlapping PAT list entries, the mtrr_lookup does not matter as we have to inherit things from those PAT entries or conflicting with them. This discussion points to - code is not sufficiently commented and/or needs some refactoring. Will look at this afresh tomorrow morning and see whether I can some up with some better alternative. Thanks, Venki Thanks, Venki --
| Srivatsa Vaddagiri | containers (was Re: -mm merge plans for 2.6.23) |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Benjamin Herrenschmidt | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
git: | |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| David Miller | [GIT]: Networking |
| Gerhard Pircher | 3c59x: shared interrupt problem |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
