From f5b2bcaf0e65e692a2c7d88bbcd8d29700ee5d62 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Tue, 5 May 2009 16:37:17 +0100 Subject: [PATCH] --- yaml --- r: 144631 b: refs/heads/master c: a425a638c858fd10370b573bde81df3ba500e271 h: refs/heads/master i: 144629: efdbb9ab619565359fffae94d7655940c326ce36 144627: 952dc201bf5bcb938ffe4450813150f0d893c430 144623: 27eded88ff12e4c3b0a5beb1136e078a7d50307e v: v3 --- [refs] | 2 +- trunk/mm/madvise.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6d81c52d098f..6204864f2142 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 99ee12973e5fd1123ed1779fb4d11ac7d381d430 +refs/heads/master: a425a638c858fd10370b573bde81df3ba500e271 diff --git a/trunk/mm/madvise.c b/trunk/mm/madvise.c index b9ce574827c8..36d6ea2b6340 100644 --- a/trunk/mm/madvise.c +++ b/trunk/mm/madvise.c @@ -112,6 +112,14 @@ static long madvise_willneed(struct vm_area_struct * vma, if (!file) return -EBADF; + /* + * Page cache readahead assumes page cache pages are order-0 which + * is not the case for hugetlbfs. Do not give a bad return value + * but ignore the advice. + */ + if (vma->vm_flags & VM_HUGETLB) + return 0; + if (file->f_mapping->a_ops->get_xip_mem) { /* no bad return value, but ignore advice */ return 0;