lkml.org 
[lkml]   [2004]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectHugepages demand paging V1 [2/4]: set_huge_pte() arch updates
Changelog
* Update set_huge_pte throughout all arches
* set_huge_pte has an additional address argument
* set_huge_pte must also do what update_mmu_cache typically does
for PAGESIZE ptes.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.9/arch/sh/mm/hugetlbpage.c
===================================================================
--- linux-2.6.9.orig/arch/sh/mm/hugetlbpage.c 2004-10-21 20:02:52.000000000 -0700
+++ linux-2.6.9/arch/sh/mm/hugetlbpage.c 2004-10-21 20:17:44.000000000 -0700
@@ -57,7 +57,8 @@
#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)

void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
- struct page *page, pte_t * page_table, int write_access)
+ struct page *page, pte_t * page_table, int write_access,
+ unsigned long address)
{
unsigned long i;
pte_t entry;
@@ -74,6 +75,7 @@

for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
set_pte(page_table, entry);
+ update_mmu_cache(vma, address, entry);
page_table++;

pte_val(entry) += PAGE_SIZE;
Index: linux-2.6.9/arch/sh64/mm/hugetlbpage.c
===================================================================
--- linux-2.6.9.orig/arch/sh64/mm/hugetlbpage.c 2004-10-18 14:53:46.000000000 -0700
+++ linux-2.6.9/arch/sh64/mm/hugetlbpage.c 2004-10-21 20:26:15.000000000 -0700
@@ -57,7 +57,8 @@
#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)

static void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
- struct page *page, pte_t * page_table, int write_access)
+ struct page *page, pte_t * page_table, int write_access,
+ unsigned long address)
{
unsigned long i;
pte_t entry;
@@ -256,7 +257,7 @@
goto out;
}
}
- set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
+ set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE, addr);
}
out:
spin_unlock(&mm->page_table_lock);
Index: linux-2.6.9/include/linux/hugetlb.h
===================================================================
--- linux-2.6.9.orig/include/linux/hugetlb.h 2004-10-21 14:50:14.000000000 -0700
+++ linux-2.6.9/include/linux/hugetlb.h 2004-10-21 20:22:45.000000000 -0700
@@ -18,7 +18,7 @@
void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
pte_t *huge_pte_alloc(struct mm_struct *, unsigned long);
-void set_huge_pte(struct mm_struct *, struct vm_area_struct *, struct page *, pte_t *, int);
+void set_huge_pte(struct mm_struct *, struct vm_area_struct *, struct page *, pte_t *, int, unsigned long);
int handle_hugetlb_mm_fault(struct mm_struct *, struct vm_area_struct *, unsigned long, int);

int hugetlb_report_meminfo(char *);
Index: linux-2.6.9/arch/sparc64/mm/hugetlbpage.c
===================================================================
--- linux-2.6.9.orig/arch/sparc64/mm/hugetlbpage.c 2004-10-21 20:02:52.000000000 -0700
+++ linux-2.6.9/arch/sparc64/mm/hugetlbpage.c 2004-10-21 20:20:20.000000000 -0700
@@ -54,7 +54,8 @@
#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)

void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma,
- struct page *page, pte_t * page_table, int write_access)
+ struct page *page, pte_t * page_table, int write_access,
+ unsigned long address)
{
unsigned long i;
pte_t entry;
@@ -71,6 +72,7 @@

for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
set_pte(page_table, entry);
+ update_mmu_cache(vma, address, entry)
page_table++;

pte_val(entry) += PAGE_SIZE;
Index: linux-2.6.9/arch/i386/mm/hugetlbpage.c
===================================================================
--- linux-2.6.9.orig/arch/i386/mm/hugetlbpage.c 2004-10-21 20:02:52.000000000 -0700
+++ linux-2.6.9/arch/i386/mm/hugetlbpage.c 2004-10-21 20:18:36.000000000 -0700
@@ -54,7 +54,8 @@
return (pte_t *) pmd;
}

-void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, struct page *page, pte_t * page_table, int write_access)
+void set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, struct page *page,
+ pte_t * page_table, int write_access, unsigned long address)
{
pte_t entry;

Index: linux-2.6.9/arch/ia64/mm/hugetlbpage.c
===================================================================
--- linux-2.6.9.orig/arch/ia64/mm/hugetlbpage.c 2004-10-21 20:02:52.000000000 -0700
+++ linux-2.6.9/arch/ia64/mm/hugetlbpage.c 2004-10-21 20:25:02.000000000 -0700
@@ -61,7 +61,7 @@

void
set_huge_pte (struct mm_struct *mm, struct vm_area_struct *vma,
- struct page *page, pte_t * page_table, int write_access)
+ struct page *page, pte_t * page_table, int write_access, unsigned long address)
{
pte_t entry;

@@ -74,6 +74,7 @@
entry = pte_mkyoung(entry);
mk_pte_huge(entry);
set_pte(page_table, entry);
+ update_mmu_cache(vma, address, entry);
return;
}
/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.191 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site