mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kill mm_struct.used_hugetlb
@ 2004-06-26 13:20 Oleg Nesterov
  2004-06-28  1:05 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2004-06-26 13:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Chen, Kenneth W, David Gibson

Hello.

mm_struct.used_hugetlb used to eliminate costly find_vma()
from follow_page(). Now it is used only in ia64 version of
follow_huge_addr(). I know nothing about ia64, but this
REGION_NUMBER() looks simple enough to kill used_hugetlb.

There is debug version (commented out) of follow_huge_addr()
in i386 which looks at used_hugetlb, but it can work without
this check.

Am i missed somethimg?

Oleg.

Signed-off: Oleg Nesterov

diff -urp 6.7-clean/arch/i386/mm/hugetlbpage.c 6.7-hugetlb/arch/i386/mm/hugetlbpage.c
--- 6.7-clean/arch/i386/mm/hugetlbpage.c	2004-05-24 14:15:58.000000000 +0400
+++ 6.7-hugetlb/arch/i386/mm/hugetlbpage.c	2004-06-26 16:48:08.000000000 +0400
@@ -147,9 +147,6 @@ follow_huge_addr(struct mm_struct *mm, u
 	struct page *page;
 	struct vm_area_struct *vma;
 
-	if (! mm->used_hugetlb)
-		return ERR_PTR(-EINVAL);
-
 	vma = find_vma(mm, addr);
 	if (!vma || !is_vm_hugetlb_page(vma))
 		return ERR_PTR(-EINVAL);
diff -urp 6.7-clean/arch/ia64/mm/hugetlbpage.c 6.7-hugetlb/arch/ia64/mm/hugetlbpage.c
--- 6.7-clean/arch/ia64/mm/hugetlbpage.c	2004-05-24 14:15:58.000000000 +0400
+++ 6.7-hugetlb/arch/ia64/mm/hugetlbpage.c	2004-06-26 16:48:21.000000000 +0400
@@ -158,8 +158,6 @@ struct page *follow_huge_addr(struct mm_
 	struct page *page;
 	pte_t *ptep;
 
-	if (! mm->used_hugetlb)
-		return ERR_PTR(-EINVAL);
 	if (REGION_NUMBER(addr) != REGION_HPAGE)
 		return ERR_PTR(-EINVAL);
 
diff -urp 6.7-clean/include/linux/hugetlb.h 6.7-hugetlb/include/linux/hugetlb.h
--- 6.7-clean/include/linux/hugetlb.h	2004-06-08 13:44:18.000000000 +0400
+++ 6.7-hugetlb/include/linux/hugetlb.h	2004-06-26 16:50:59.000000000 +0400
@@ -34,13 +34,6 @@ extern unsigned long max_huge_pages;
 extern const unsigned long hugetlb_zero, hugetlb_infinity;
 extern int sysctl_hugetlb_shm_group;
 
-static inline void
-mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma)
-{
-	if (is_vm_hugetlb_page(vma))
-		mm->used_hugetlb = 1;
-}
-
 #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE
 #define is_hugepage_only_range(addr, len)	0
 #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0)
@@ -72,7 +65,6 @@ static inline unsigned long hugetlb_tota
 #define unmap_hugepage_range(vma, start, end)	BUG()
 #define is_hugepage_mem_enough(size)		0
 #define hugetlb_report_meminfo(buf)		0
-#define mark_mm_hugetlb(mm, vma)		do { } while (0)
 #define follow_huge_pmd(mm, addr, pmd, write)	0
 #define is_aligned_hugepage_range(addr, len)	0
 #define prepare_hugepage_range(addr, len)	(-EINVAL)
diff -urp 6.7-clean/include/linux/sched.h 6.7-hugetlb/include/linux/sched.h
--- 6.7-clean/include/linux/sched.h	2004-06-16 12:38:59.000000000 +0400
+++ 6.7-hugetlb/include/linux/sched.h	2004-06-26 16:49:06.000000000 +0400
@@ -217,9 +217,6 @@ struct mm_struct {
 	unsigned long saved_auxv[40]; /* for /proc/PID/auxv */
 
 	unsigned dumpable:1;
-#ifdef CONFIG_HUGETLB_PAGE
-	int used_hugetlb;
-#endif
 	cpumask_t cpu_vm_mask;
 
 	/* Architecture-specific MM context */
diff -urp 6.7-clean/mm/mmap.c 6.7-hugetlb/mm/mmap.c
--- 6.7-clean/mm/mmap.c	2004-06-08 13:44:19.000000000 +0400
+++ 6.7-hugetlb/mm/mmap.c	2004-06-26 16:51:21.000000000 +0400
@@ -318,7 +318,6 @@ static void vma_link(struct mm_struct *m
 	if (mapping)
 		spin_unlock(&mapping->i_mmap_lock);
 
-	mark_mm_hugetlb(mm, vma);
 	mm->map_count++;
 	validate_mm(mm);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-28  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-26 13:20 [PATCH] kill mm_struct.used_hugetlb Oleg Nesterov
2004-06-28  1:05 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®