WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-merge

RE: [Xen-merge] arch/i386/mach-xen/mm/highmem.c indentical

To: "Martin J. Bligh" <mbligh@xxxxxxxxxx>, "xen-merge" <xen-merge@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-merge] arch/i386/mach-xen/mm/highmem.c indentical
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Tue, 9 Aug 2005 11:13:57 +0100
Delivery-date: Tue, 09 Aug 2005 10:12:06 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-merge-request@lists.xensource.com?subject=help>
List-id: xen-merge <xen-merge.lists.xensource.com>
List-post: <mailto:xen-merge@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-merge-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcWbcdgmaLXSpbpeRpWi6/ZfbDQ/OwBV9y3w
Thread-topic: [Xen-merge] arch/i386/mach-xen/mm/highmem.c indentical
 
> arch/i386/mach-xen/mm/highmem.c is another one to remove it seems?

I've actually got a patch sitting in my tree that touches this file, and
is important for making kmap (>900MB) work well on Xen. I haven't
checked it in because I don't totally like the approach of introducing
"kset_pte_at", though we clearly need something checked in because it's
a huge win on some benchmarks.

The extra optimization in highmem.c is to fold the flush into the
update_va_mapping (which is quite a bit faster than set_pte).

Ian

diff -r e9b950192ba6 linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c   Wed Aug  3
21:17:17 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c   Thu Aug  4
19:07:42 2005
@@ -41,8 +41,17 @@
        if (!pte_none(*(kmap_pte-idx)))
                BUG();
 #endif
-       set_pte(kmap_pte-idx, mk_pte(page, prot));
-       __flush_tlb_one(vaddr);
+
+       /* Optimize by using linear mapping */
+       if (HYPERVISOR_update_va_mapping(
+               vaddr,
+               mk_pte(page, prot),
+               UVMF_TLB_FLUSH ) )
+       {
+               /* just in case this isn't mapped in to the PGD */
+               set_pte( kmap_pte-idx, mk_pte(page, prot));     
+               __flush_tlb_one(vaddr);
+       }
 
        return (void*) vaddr;
 }
diff -r e9b950192ba6
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
Wed Aug  3 21:17:17 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
Thu Aug  4 19:07:42 2005
@@ -16,6 +16,18 @@
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
+
+#define kset_pte_at(addr,ptep,pteval) ({
\
+       if (HYPERVISOR_update_va_mapping(
\
+                (addr),
\
+                (pteval), 0 ) )
\
+        {
\
+                /* just in case this isn't mapped in to the PGD */
\
+                set_pte( (ptep), (pteval));
\
+       }
\
+})
+
+
 
 #ifndef CONFIG_XEN_SHADOW_MODE
 #define set_pmd(pmdptr, pmdval) xen_l2_entry_update((pmdptr), (pmdval))
diff -r e9b950192ba6 linux-2.6-xen-sparse/mm/highmem.c
--- a/linux-2.6-xen-sparse/mm/highmem.c Wed Aug  3 21:17:17 2005
+++ b/linux-2.6-xen-sparse/mm/highmem.c Thu Aug  4 19:07:42 2005
@@ -139,7 +139,7 @@
                }
        }
        vaddr = PKMAP_ADDR(last_pkmap_nr);
-       set_pte_at(&init_mm, vaddr,
+       kset_pte_at(vaddr,
                   &(pkmap_page_table[last_pkmap_nr]), mk_pte(page,
kmap_prot));
 
        pkmap_count[last_pkmap_nr] = 1;

diff -u mm/vmalloc.c mm/vmalloc.c.orig
--- mm/vmalloc.c        2005-06-17 20:48:29.000000000 +0100
+++ mm/vmalloc.c.orig   2005-08-09 11:11:56.120999000 +0100
@@ -96,7 +96,7 @@
                WARN_ON(!pte_none(*pte));
                if (!page)
                        return -ENOMEM;
-               set_pte_at(&init_mm, addr, pte, mk_pte(page, prot));
+               kset_pte_at(addr, pte, mk_pte(page, prot));
                (*pages)++;
        } while (pte++, addr += PAGE_SIZE, addr != end);
        return 0;

_______________________________________________
Xen-merge mailing list
Xen-merge@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-merge