From d0d620f9390e37d17cb432e1c567979408ddd34d Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Fri, 23 Apr 2010 13:17:56 -0400 Subject: [PATCH] --- yaml --- r: 190196 b: refs/heads/master c: 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/poison.h | 9 +++++++++ trunk/mm/hugetlb.c | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 53f8abf51e35..3bd3c079f033 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9a6a1ecd9e9b5d046a236da2f7eb6b6812f04229 +refs/heads/master: 23be7468e8802a2ac1de6ee3eecb3ec7f14dc703 diff --git a/trunk/include/linux/poison.h b/trunk/include/linux/poison.h index 2110a81c5e2a..34066ffd893d 100644 --- a/trunk/include/linux/poison.h +++ b/trunk/include/linux/poison.h @@ -48,6 +48,15 @@ #define POISON_FREE 0x6b /* for use-after-free poisoning */ #define POISON_END 0xa5 /* end-byte of poisoning */ +/********** mm/hugetlb.c **********/ +/* + * Private mappings of hugetlb pages use this poisoned value for + * page->mapping. The core VM should not be doing anything with this mapping + * but futex requires the existence of some page->mapping value even though it + * is unused if PAGE_MAPPING_ANON is set. + */ +#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) + /********** arch/$ARCH/mm/init.c **********/ #define POISON_FREE_INITMEM 0xcc diff --git a/trunk/mm/hugetlb.c b/trunk/mm/hugetlb.c index 6034dc9e9796..ffbdfc86aedf 100644 --- a/trunk/mm/hugetlb.c +++ b/trunk/mm/hugetlb.c @@ -546,6 +546,7 @@ static void free_huge_page(struct page *page) mapping = (struct address_space *) page_private(page); set_page_private(page, 0); + page->mapping = NULL; BUG_ON(page_count(page)); INIT_LIST_HEAD(&page->lru); @@ -2447,8 +2448,10 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, spin_lock(&inode->i_lock); inode->i_blocks += blocks_per_huge_page(h); spin_unlock(&inode->i_lock); - } else + } else { lock_page(page); + page->mapping = HUGETLB_POISON; + } } /*