[Patch 26/29] GRU - Add hugepage support

steiner
2009-11-24T15:09:30Z

[-- Attachment #1: uv_gru_hugepages --]
[-- Type: text/plain, Size: 946 bytes --]

From: Jack Steiner <steiner@sgi.com>

Add support for hugepages. Easier than I originally thought.

Signed-off-by: Jack Steiner <steiner@sgi.com>

---
drivers/misc/sgi-gru/grufault.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux/drivers/misc/sgi-gru/grufault.c
===================================================================
--- linux.orig/drivers/misc/sgi-gru/grufault.c 2009-11-20 09:32:36.000000000 -0600
+++ linux/drivers/misc/sgi-gru/grufault.c 2009-11-20 09:32:38.000000000 -0600
@@ -192,10 +192,11 @@ static int non_atomic_pte_lookup(struct
{
struct page *page;

- /* ZZZ Need to handle HUGE pages */
- if (is_vm_hugetlb_page(vma))
- return -EFAULT;
+#ifdef CONFIG_HUGETLB_PAGE
+ *pageshift = is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT;
+#else
*pageshift = PAGE_SHIFT;
+#endif
if (get_user_pages
(current, current->mm, vaddr, 1, write, 0, &page, NULL) <= 0)
return -EFAULT;