Skip to contentSkip to conversation

ARM: Fix compile after delay page freeing patch

PATCH New Tony Lindgren 4 participants 12 messages Feb 22, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix this by including pagemap.h.

arch/arm/mm/init.c +1 -0
@@ -19,6 +19,7 @@
 #include <linux/gfp.h>
 #include <linux/memblock.h>
 #include <linux/sort.h>
+#include <linux/pagemap.h>
 
 #include <asm/mach-types.h>
 #include <asm/sections.h>
#1 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

Hello.

Quoted 17 lines · Tony Lindgren

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix this by including pagemap.h.

arch/arm/mm/init.c line 25

Quoted 7 lines
arch/arm/mm/init.c +1 -0
@@ -19,6 +19,7 @@
 #include <linux/gfp.h>
 #include <linux/memblock.h>
 #include <linux/sort.h>
+#include <linux/pagemap.h>
 
 #include <asm/mach-types.h>
 #include <asm/sections.h>

Shouldn't you be #including it into tlb.h instead?

WBR, Sergei

#2 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

Quoted 18 lines · Sergei Shtylyov

Hello.

Quoted 14 lines · Tony Lindgren

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix this by including pagemap.h.

Quoted 11 lines

arch/arm/mm/init.c line 24

Quoted 9 lines
arch/arm/mm/init.c +1 -0
@@ -19,6 +19,7 @@
 #include <linux/gfp.h>
 #include <linux/memblock.h>
 #include <linux/sort.h>
+#include <linux/pagemap.h>
 #include <asm/mach-types.h>
 #include <asm/sections.h>

Shouldn't you be #including it into tlb.h instead?

Hmm, pagemap.h actually seems to be there in tlb.h, but in #ifndef CONFIG_MMU.

Tony

#3 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

In reply to Sergei Shtylyov
Quoted 7 lines · Sergei Shtylyov

Hello.

Quoted 3 lines · Tony Lindgren

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

I't not omap1_defconfig only, see

	http://armlinux.simtec.co.uk/kautobuild/2.6.38-rc5-git6/index.html
Quoted 10 lines
Quoted 10 lines

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix this by including pagemap.h.

Quoted 11 lines

arch/arm/mm/init.c line 24

Quoted 9 lines
arch/arm/mm/init.c +1 -0
@@ -19,6 +19,7 @@
 #include <linux/gfp.h>
 #include <linux/memblock.h>
 #include <linux/sort.h>
+#include <linux/pagemap.h>
 #include <asm/mach-types.h>
 #include <asm/sections.h>

Shouldn't you be #including it into tlb.h instead?

For me building arch/arm/mm/mmu.o fails, too. So Tony's patch doesn't help.

Adding the #include to arch/arm/include/asm/tlb.h works fine though.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

In reply to Tony Lindgren
Quoted 9 lines · Tony Lindgren

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Grant already mentioned this to me this evening.

This happens if you build with CONFIG_SWAP=n, and is something that the asm-generic/tlb.h also appears to suffer from. Why no one else has noticed this I've no idea.

Note that linux/swap.h has this comment:

/* only sparc can not include linux/pagemap.h in this file
* so leave page_cache_release and release_pages undeclared... */
#define free_page_and_swap_cache(page) \
page_cache_release(page)

#define free_pages_and_swap_cache(pages, nr) \
        release_pages((pages), (nr), 0);

which is rather annoying, because it makes the build error dependent on the configuration.

So, we should add linux/pagemap.h to both asm-generic/tlb.h and the ARM tlb.h as they both should suffer the same problem.

Note that arch/x86/mm/init.c and arch/x86/mm/pgtable.c both include asm/tlb.h without linux/pagemap.h, and use the generic version. I bet no one's tried building x86 with CONFIG_SWAP=n yet...

#5 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

Hello Russell,

Quoted 3 lines · Russell King - ARM Linux

Note that arch/x86/mm/init.c and arch/x86/mm/pgtable.c both include asm/tlb.h without linux/pagemap.h, and use the generic version. I bet no one's tried building x86 with CONFIG_SWAP=n yet...

I did, and it doesn't fail.

include/asm-generic/tlb.h includes <asm/pgalloc.h> which for x86 includes <linux/pagemap.h>

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#6 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

Quoted 10 lines · Uwe Kleine-K?nig

Hello Russell,

Quoted 3 lines · Russell King - ARM Linux

Note that arch/x86/mm/init.c and arch/x86/mm/pgtable.c both include asm/tlb.h without linux/pagemap.h, and use the generic version. I bet no one's tried building x86 with CONFIG_SWAP=n yet...

I did, and it doesn't fail.

include/asm-generic/tlb.h includes <asm/pgalloc.h> which for x86 includes <linux/pagemap.h>

Maybe then we should add linux/pagemap.h to our asm/pgalloc.h.

#7 lore raw

PATCH 1/1 ARM: fix build failure

Commit

06824ba (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs)

introduced a build failure for builds with CONFIG_SWAP=n:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix that by #including <linux/pagemap.h> in <asm/pgalloc.h> as it's done by x86.

---
 arch/arm/include/asm/pgalloc.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/include/asm/pgalloc.h +2 -0
index 9763be0..22de005 100644
@@ -10,6 +10,8 @@
 #ifndef _ASMARM_PGALLOC_H
 #define _ASMARM_PGALLOC_H
 
+#include <linux/pagemap.h>
+
 #include <asm/domain.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/processor.h>
Signature · 1 line
1.7.2.3
#8 lore raw

PATCH 1/1 ARM: fix build failure

Quoted 12 lines · Uwe Kleine-K?nig

Commit

06824ba (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs)

introduced a build failure for builds with CONFIG_SWAP=n:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Quoted 4 lines

Fix that by #including <linux/pagemap.h> in <asm/pgalloc.h> as it's done by x86.

#9 lore raw

PATCH 1/1 ARM: fix build failure

In reply to Uwe Kleine-König

Looks good. Can you stick it in the patch system please?

Quoted 36 lines · Uwe Kleine-K?nig

Commit

06824ba (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs)

introduced a build failure for builds with CONFIG_SWAP=n:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Fix that by #including <linux/pagemap.h> in <asm/pgalloc.h> as it's done by x86.

---
 arch/arm/include/asm/pgalloc.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/include/asm/pgalloc.h +2 -0
index 9763be0..22de005 100644
@@ -10,6 +10,8 @@
 #ifndef _ASMARM_PGALLOC_H
 #define _ASMARM_PGALLOC_H
 
+#include <linux/pagemap.h>
+
 #include <asm/domain.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/processor.h>
Signature · 1 line
1.7.2.3
#11 lore raw

PATCH 1/1 ARM: Fix compile after delay page freeing patch

In reply to Russell King - ARM Linux
Quoted 29 lines · Russell King - ARM Linux
Quoted 9 lines · Tony Lindgren

Commit 06824ba824b3e9f2fedb38bee79af0643198ed7f (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs) causes the following compile error for at least omap1_defconfig:

In file included from arch/arm/mm/init.c:27:
arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages' arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'

Grant already mentioned this to me this evening.

This happens if you build with CONFIG_SWAP=n, and is something that the asm-generic/tlb.h also appears to suffer from. Why no one else has noticed this I've no idea.

Note that linux/swap.h has this comment:

/* only sparc can not include linux/pagemap.h in this file
* so leave page_cache_release and release_pages undeclared... */
#define free_page_and_swap_cache(page) \
page_cache_release(page)

#define free_pages_and_swap_cache(pages, nr) \
        release_pages((pages), (nr), 0);

which is rather annoying, because it makes the build error dependent on the configuration.

Quoted 6 lines

So, we should add linux/pagemap.h to both asm-generic/tlb.h and the ARM tlb.h as they both should suffer the same problem.

Note that arch/x86/mm/init.c and arch/x86/mm/pgtable.c both include asm/tlb.h without linux/pagemap.h, and use the generic version. I bet no one's tried building x86 with CONFIG_SWAP=n yet...

Looks like it's in arch/x86/mm/init_[32|64].c and pgtable[32|64].c though. So maybe we just need to patch either ARM tlb.h. Or patch the necessary .c files to include pagemap.h.

Regards,

Tony