Commit 919de8f5 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[PATCH] hugetlb: remove /proc/ intrusion

Patch from William Lee Irwin III <wli@holomorphy.com>

This patch removes hugetlb's intrusion into /proc/
parent 20078cee
...@@ -582,6 +582,17 @@ static int __init hugetlb_init(void) ...@@ -582,6 +582,17 @@ static int __init hugetlb_init(void)
} }
module_init(hugetlb_init); module_init(hugetlb_init);
int hugetlb_report_meminfo(char *buf)
{
return sprintf(buf,
"HugePages_Total: %5lu\n"
"HugePages_Free: %5lu\n"
"Hugepagesize: %5lu kB\n",
htlbzone_pages,
htlbpagemem,
HPAGE_SIZE/1024);
}
static struct page * hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) static struct page * hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused)
{ {
BUG(); BUG();
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <linux/times.h> #include <linux/times.h>
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hugetlb.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -199,19 +199,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -199,19 +199,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
ps.nr_reverse_maps ps.nr_reverse_maps
); );
#ifdef CONFIG_HUGETLB_PAGE len += hugetlb_report_meminfo(page + len);
{
extern unsigned long htlbpagemem, htlbzone_pages;
len += sprintf(page + len,
"HugePages_Total: %5lu\n"
"HugePages_Free: %5lu\n"
"Hugepagesize: %5lu kB\n",
htlbzone_pages,
htlbpagemem,
HPAGE_SIZE/1024);
}
#endif
return proc_calc_metrics(page, start, off, count, eof, len); return proc_calc_metrics(page, start, off, count, eof, len);
#undef K #undef K
} }
......
...@@ -17,6 +17,7 @@ void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); ...@@ -17,6 +17,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); void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
int hugetlb_prefault(struct address_space *, struct vm_area_struct *); int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
void huge_page_release(struct page *); void huge_page_release(struct page *);
int hugetlb_report_meminfo(char *);
extern int htlbpage_max; extern int htlbpage_max;
...@@ -32,6 +33,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) ...@@ -32,6 +33,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
#define zap_hugepage_range(vma, start, len) BUG() #define zap_hugepage_range(vma, start, len) BUG()
#define unmap_hugepage_range(vma, start, end) BUG() #define unmap_hugepage_range(vma, start, end) BUG()
#define huge_page_release(page) BUG() #define huge_page_release(page) BUG()
#define hugetlb_report_meminfo(buf) 0
#endif /* !CONFIG_HUGETLB_PAGE */ #endif /* !CONFIG_HUGETLB_PAGE */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment