[lkml]   [2008]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] [6/8] Account overlapped mappings in end_pfn_map

* Andi Kleen <> wrote:

> When end_pfn is not aligned to 2MB (or 1GB) then the kernel might map
> more memory than end_pfn. Account this in end_pfn_mapped.

can you see any practical relevance? Your patch description only deals
with the mechanical details of the change instead of analyzing the most
important thing: relevance and impact analysis. That makes it harder to
add your patches and easier to miss a good fix accidentally. It also
makes it quite a bit harder to trust your patches.

at a quick glance the relevance is to EFI only, in
efi_enter_virtual_mode(). max_pfn_mapped is used as a differentiator
between __va() and efi_ioremap(). AFAICS EFI will typically have its
runtime code not right after the end of physical memory.

Nevertheless, i do agree that the max_pfn_mapped/end_pfn_map limit needs
to be sharpened to reflect reality (for later PAT support).

your patch is also a bit unclean:

> -static void __meminit
> +static unsigned long __meminit
> phys_pmd_update(pud_t *pud, unsigned long address, unsigned long end)
> {
> + unsigned long r;
> pmd_t *pmd = pmd_offset(pud, 0);
> spin_lock(&init_mm.page_table_lock);
> - phys_pmd_init(pmd, address, end);
> + r = phys_pmd_init(pmd, address, end);
> spin_unlock(&init_mm.page_table_lock);
> __flush_tlb_all();
> + return r;
> }

a meaningless "r" parameter. Use "true_end" instead.

and here's another type of variable naming problem:

> +unsigned long __init_refok
> +init_memory_mapping(unsigned long start, unsigned long end)
> {
> - unsigned long next;
> + unsigned long next, true_end = end;

that "true_end" is already a _pfn_, so name it accordingly:
true_end_pfn. Because we switch between pfn and addr types it's
important to point out where it's pfn and where it's a linear/physical

> struct zone *zone = pgdat->node_zones + ZONE_NORMAL;
> unsigned long start_pfn = start >> PAGE_SHIFT;
> unsigned long nr_pages = size >> PAGE_SHIFT;
> + unsigned long r;
> int ret;
> - init_memory_mapping(start, start + size-1);
> + r = init_memory_mapping(start, start + size-1);
> + if (r > end_pfn_map)
> + end_pfn_map = r;

rename "r" to "true_end_pfn".


 \ /
  Last update: 2008-02-11 14:11    [W:0.155 / U:1.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site