Re: [PATCH] THP: need is_vma_temporary_stack() when reference transparent_hugepage_enabled

From: Alex Shi
Date: Tue May 01 2012 - 23:18:34 EST


On 05/01/2012 07:05 AM, Andrew Morton wrote:

> On Sat, 28 Apr 2012 14:33:15 +0800
> Alex Shi <alex.shi@xxxxxxxxx> wrote:
>
>> When the transparent_hugepage_enabled() used out of mm/,
>> is_vma_temporary_stack() need be referenced. Otherwise, it has compile
>> error.
>
> This is a poor changelog - it doesn't tell us how this compilation
> error comes about. Is there some known build error in the mainline
> kernel, or did you discover this when altering the kernel, or what?

>

> One of the several reasons for this information is to permit others to
> work out which kernel version(s) should be fixed.
>




I am sorry for the unclear log!
When I try to transparent_hugepage_enabled() in arch/x86/mm/tlb.c with
huge_mm.h include: +#include <linux/huge_mm.h>. make give me the following
error:
...
CC arch/x86/mm/srat.o
arch/x86/mm/tlb.c: In function ‘flush_tlb_range’:
arch/x86/mm/tlb.c:324:4: error: implicit declaration of function ‘is_vma_temporary_stack’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
...
Since it is not convenitant for user to include 2 head files just for one
target function, I send this patch.

> is_vma_temporary_stack() is already declared in rmap.h. We should not
> declare it in two places.




Oh, yes. Since is_vma_temporay_stack is just used in rmap.c and huge_memory.c
. is it better to move it to huge_mm.h?

---