Skip to contentSkip to conversation

Powerpc - Include pagemap.h in asm/powerpc/tlb.h

PATCH Mathieu Desnoyers 3 participants 8 messages Jul 14, 2007 – Jul 19, 2007

lore
Share & tools
lore
#0 lore raw

Powerpc - Include pagemap.h in asm/powerpc/tlb.h

Fixes this powerpc build error in 2.6.22-rc6-mm1 for powerpc 64 :

In file included from include2/asm/tlb.h:60,

                 from /home/compudj/git/linux-2.6-lttng/arch/powerpc/mm/init_64.

c:56:
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_fl ush_mmu':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:76: error: implicit declaration of function 'release_pages' /home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_re move_page':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:105: error: implicit
declaration of function 'page_cache_release'
make[2]: *** [arch/powerpc/mm/init_64.o] Error 1

release_pages is declared in linux/pagemap.h, but cannot be included in linux/swap.h because of a sparc related 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);
---
 include/asm-powerpc/tlb.h |    2 ++
 1 file changed, 2 insertions(+)
include/asm-powerpc/tlb.h +2 -0
Index: linux-2.6-lttng/include/asm-powerpc/tlb.h
===================================================================
@@ -23,6 +23,8 @@
 #include <asm/mmu.h>
 #endif
 
+#include <linux/pagemap.h>
+
 struct mmu_gather;
 
 #define tlb_start_vma(tlb, vma)	do { } while (0)
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#1 lore raw
Quoted 6 lines · On Fri, 13 Jul 2007 21:20:33 -0400 Mathieu Desnoyers…

Powerpc - Include pagemap.h in asm/powerpc/tlb.h

Fixes this powerpc build error in 2.6.22-rc6-mm1 for powerpc 64 :

In file included from include2/asm/tlb.h:60,

                 from /home/compudj/git/linux-2.6-lttng/arch/powerpc/mm/init_64.
Quoted 9 lines

c:56:
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_fl ush_mmu':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:76: error: implicit declaration of function 'release_pages' /home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_re move_page':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:105: error: implicit
declaration of function 'page_cache_release'

You have some wordwrapping going on there.

Quoted 11 lines

make[2]: *** [arch/powerpc/mm/init_64.o] Error 1

release_pages is declared in linux/pagemap.h, but cannot be included in linux/swap.h because of a sparc related 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);

It's always a worry when this happens. What change made us need this inclusion? How come you're hitting it but I (and test.kernel.org, at least) did not? How come so few other architectures include pagemap.h from asm/tlb.h? Why do header files get into such a mess?

Quoted 12 lines
---
 include/asm-powerpc/tlb.h |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6-lttng/include/asm-powerpc/tlb.h
===================================================================

include/asm-powerpc/tlb.h line 29

Quoted 7 lines
include/asm-powerpc/tlb.h +2 -0
@@ -23,6 +23,8 @@
 #include <asm/mmu.h>
 #endif
 
+#include <linux/pagemap.h>
+
 struct mmu_gather;
 

Oh well. I queued it up for someone else to worry over ;)

#2 lore raw
Quoted 56 lines · Andrew Morton
Quoted 4 lines · On Fri, 13 Jul 2007 21:20:33 -0400 Mathieu Desnoyers…

Powerpc - Include pagemap.h in asm/powerpc/tlb.h

Fixes this powerpc build error in 2.6.22-rc6-mm1 for powerpc 64 :

Quoted 12 lines

In file included from include2/asm/tlb.h:60,
from /home/compudj/git/linux-2.6-lttng/arch/
powerpc/mm/init_64.
c:56:
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_fl ush_mmu':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:76: error: implicit declaration of function 'release_pages' /home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_re move_page':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:105: error: implicit
declaration of function 'page_cache_release'

You have some wordwrapping going on there.

Quoted 11 lines

make[2]: *** [arch/powerpc/mm/init_64.o] Error 1

release_pages is declared in linux/pagemap.h, but cannot be included in linux/swap.h because of a sparc related 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);

It's always a worry when this happens. What change made us need this inclusion? How come you're hitting it but I (and test.kernel.org, at least) did not? How come so few other architectures include pagemap.h from asm/tlb.h? Why do header files get into such a mess?

Quoted 17 lines
---
 include/asm-powerpc/tlb.h |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6-lttng/include/asm-powerpc/tlb.h
===================================================================
--- linux-2.6-lttng.orig/include/asm-powerpc/tlb.h 2007-07-13
11:30:54.000000000 -0400
+++ linux-2.6-lttng/include/asm-powerpc/tlb.h 2007-07-13
11:31:22.000000000 -0400

include/asm-powerpc/tlb.h +0 -0
@@ -23,6 +23,8 @@
 #include <asm/mmu.h>
 #endif
 
Quoted 6 lines

include/asm-powerpc/tlb.h line 29

Quoted 4 lines
include/asm-powerpc/tlb.h +2 -0
+#include <linux/pagemap.h>
+
 struct mmu_gather;
 

Oh well. I queued it up for someone else to worry over ;)

Andrew,

Are you sending this to linus directly or should this go via paul and me?

- k

#3 lore raw
Quoted 73 lines · On Thu, 19 Jul 2007 14:55:23 -0500 Kumar Gala <[email protected]> wrote:
Quoted 63 lines · Andrew Morton
Quoted 4 lines · On Fri, 13 Jul 2007 21:20:33 -0400 Mathieu Desnoyers…

Powerpc - Include pagemap.h in asm/powerpc/tlb.h

Fixes this powerpc build error in 2.6.22-rc6-mm1 for powerpc 64 :

Quoted 16 lines

In file included from include2/asm/tlb.h:60,
from /home/compudj/git/linux-2.6-lttng/arch/
powerpc/mm/init_64.
c:56:
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_fl
ush_mmu':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:76:
error: implicit
declaration of function 'release_pages' /home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h: In function 'tlb_re
move_page':
/home/compudj/git/linux-2.6-lttng/include/asm-generic/tlb.h:105:
error: implicit
declaration of function 'page_cache_release'

You have some wordwrapping going on there.

Quoted 6 lines

make[2]: *** [arch/powerpc/mm/init_64.o] Error 1

release_pages is declared in linux/pagemap.h, but cannot be included in
linux/swap.h because of a sparc related comment:

Quoted 6 lines

/* 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);

It's always a worry when this happens. What change made us need this inclusion? How come you're hitting it but I (and test.kernel.org, at least)
did not? How come so few other architectures include pagemap.h from asm/tlb.h? Why do header files get into such a mess?

Quoted 17 lines
---
 include/asm-powerpc/tlb.h |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6-lttng/include/asm-powerpc/tlb.h
===================================================================
--- linux-2.6-lttng.orig/include/asm-powerpc/tlb.h 2007-07-13
11:30:54.000000000 -0400
+++ linux-2.6-lttng/include/asm-powerpc/tlb.h 2007-07-13
11:31:22.000000000 -0400

include/asm-powerpc/tlb.h +0 -0
@@ -23,6 +23,8 @@
 #include <asm/mmu.h>
 #endif
 
Quoted 6 lines

include/asm-powerpc/tlb.h line 29

Quoted 4 lines
include/asm-powerpc/tlb.h +2 -0
+#include <linux/pagemap.h>
+
 struct mmu_gather;
 

Oh well. I queued it up for someone else to worry over ;)

Quoted 5 lines

Andrew,

Are you sending this to linus directly or should this go via paul and me?

I queued it up for Paul. I can send it over to Linus today if we have a reason for that. It's just that I dont understand the patch: does it fix -mm-only breakage? Does it fix something which already got fixed, or what?

One might think "gee, it's trivial, just slam it in", but these nested includes are often not-trivial and something else can explode as a result.

#4 lore raw
Quoted 10 lines
Quoted 5 lines

Andrew,

Are you sending this to linus directly or should this go via paul and me?

I queued it up for Paul. I can send it over to Linus today if we have a reason for that. It's just that I dont understand the patch: does it fix -mm-only breakage? Does it fix something which already got fixed, or what?

I'm seeing the same breakage in my tree.

Quoted 2 lines

One might think "gee, it's trivial, just slam it in", but these nested includes are often not-trivial and something else can explode as a result.

I'll do a git-bisect and see if I can find the patch that causes this breakage so we know what's going on.

- k

#5 lore raw
Quoted 6 lines · On Thu, 19 Jul 2007 16:04:38 -0500 Kumar Gala <[email protected]> wrote:
Quoted 6 lines
Quoted 5 lines

Andrew,

Are you sending this to linus directly or should this go via paul and me?

Quoted 8 lines
Quoted 6 lines

I queued it up for Paul. I can send it over to Linus today if we have a
reason for that. It's just that I dont understand the patch: does it fix
-mm-only breakage? Does it fix something which already got fixed, or what?

I'm seeing the same breakage in my tree.

Oh, OK. Let's just merge it.

Quoted 6 lines
Quoted 3 lines

One might think "gee, it's trivial, just slam it in", but these nested includes are often not-trivial and something else can explode as a result.

I'll do a git-bisect and see if I can find the patch that causes this breakage so we know what's going on.

eh, don't bother.

#6 lore raw
Quoted 20 lines · * Andrew Morton ([email protected]) wrote:
Quoted 6 lines · On Thu, 19 Jul 2007 16:04:38 -0500 Kumar Gala <[email protected]> wrote:
Quoted 6 lines
Quoted 5 lines

Andrew,

Are you sending this to linus directly or should this go via paul and me?

Quoted 8 lines
Quoted 6 lines

I queued it up for Paul. I can send it over to Linus today if we have a
reason for that. It's just that I dont understand the patch: does it fix
-mm-only breakage? Does it fix something which already got fixed, or what?

I'm seeing the same breakage in my tree.

Oh, OK. Let's just merge it.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

One might think "gee, it's trivial, just slam it in", but these nested includes are often not-trivial and something else can explode as a result.

I'll do a git-bisect and see if I can find the patch that causes this breakage so we know what's going on.

eh, don't bother.

Hrm, I still think it's kind of interesting to see what happens there.

So the sane way to make sure it's fixed would be to turn the macros free_page_and_swap_cache() and free_pages_and_swap_cache() into an inline function (just to make sure the compiler complains), but that would require to include linux/pagemap.h from linux/swap.h. But let's just see what happens on sparc if we include linux/pagemap.h from swap.h.

I just tested compiling on sparc, here is the result:

/opt/crosstool/gcc-4.1.1-glibc-2.3.6/sparc-unknown-linux-gnu/bin/sparc-unknown-linux-gnu-gcc -Wp,-MD,init/.main.o.d -nostdinc -isystem /opt/crosstool/gcc-4.1.1-glibc-2.3.6/sparc-unknown-linux-gnu/lib/gcc/sparc-unknown-linux-gnu/4.1.1/include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/compudj/git/linux-2.6-lttng/include -include include/linux/autoconf.h -I/home/compudj/git/linux-2.6-lttng/init -Iinit -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(main)" -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o init/.tmp_main.o /home/compudj/git/linux-2.6-lttng/init/main.c
In file included from /home/compudj/git/linux-2.6-lttng/include/linux/highmem.h:24,

                 from /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:10,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/swap.h:9,
                 from include2/asm/pgtable.h:15,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/mm.h:38,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/rmap.h:9,
                 from /home/compudj/git/linux-2.6-lttng/init/main.c:49:

include2/asm/highmem.h: In function 'kmap':
include2/asm/highmem.h:60: error: implicit declaration of function 'PageHighMem' include2/asm/highmem.h:61: error: implicit declaration of function 'page_address' include2/asm/highmem.h:61: warning: return makes pointer from integer without a cast In file included from /home/compudj/git/linux-2.6-lttng/include/linux/swap.h:9,

                 from include2/asm/pgtable.h:15,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/mm.h:38,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/rmap.h:9,
                 from /home/compudj/git/linux-2.6-lttng/init/main.c:49:

/home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h: In function 'linear_page_index':
/home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:153: error: dereferencing pointer to incomplete type /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:154: error: dereferencing pointer to incomplete type /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h: In function 'lock_page':
/home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:168: error: implicit declaration of function 'TestSetPageLocked' /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h: In function 'wait_on_page_locked':
/home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:198: error: implicit declaration of function 'PageLocked' /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:199: error: 'PG_locked' undeclared (first use in this function) /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:199: error: (Each undeclared identifier is reported only once /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:199: error: for each function it appears in.) /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h: In function 'wait_on_page_writeback':
/home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:207: error: implicit declaration of function 'PageWriteback' /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:208: error: 'PG_writeback' undeclared (first use in this function) In file included from /home/compudj/git/linux-2.6-lttng/include/linux/rmap.h:9,

                 from /home/compudj/git/linux-2.6-lttng/init/main.c:49:

/home/compudj/git/linux-2.6-lttng/include/linux/mm.h: At top level:
/home/compudj/git/linux-2.6-lttng/include/linux/mm.h:605: error: conflicting types for 'page_address' include2/asm/highmem.h:61: error: previous implicit declaration of 'page_address' was here

PageHighMem is declared in linux/page-flags.h, which is included in linux/mm.h with the following comment:

/*
* FIXME: take this include out, include page-flags.h in
* files which need it (119 of them)
*/
#include <linux/page-flags.h>

(linux/mm.h is included from linux/highmem.h)

Actually, we get a circular inclusion there:

In file included from /home/compudj/git/linux-2.6-lttng/include/linux/highmem.h:24,

                 from /home/compudj/git/linux-2.6-lttng/include/linux/pagemap.h:10,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/swap.h:9,
                 from include2/asm/pgtable.h:15,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/mm.h:38,
                 from /home/compudj/git/linux-2.6-lttng/include/linux/rmap.h:9,
                 from /home/compudj/git/linux-2.6-lttng/init/main.c:49:

mm.h includes asm-sparc/pgtable.h includes linux/swap.h includes linux/pagemap.h (which I have added myself) includes linux/highmem.h includes mm.h.....

Is it me or it all looks like a fubarish mess ? :(

Why is asm-sparc/pgtable.h including linux/swap.h ? Perharps the sparc devs will be able to enlighten us...

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#7 lore raw
In reply to Andrew Morton
Quoted 16 lines · Andrew Morton
Quoted 13 lines · On Thu, 19 Jul 2007 16:04:38 -0500 Kumar Gala <[email protected]> wrote:
Quoted 12 lines
Quoted 5 lines

Andrew,

Are you sending this to linus directly or should this go via paul and me?

I queued it up for Paul. I can send it over to Linus today if we have a
reason for that. It's just that I dont understand the patch: does it fix
-mm-only breakage? Does it fix something which already got fixed, or what?

Quoted 3 lines
Quoted 1 line

I'm seeing the same breakage in my tree.

Oh, OK. Let's just merge it.

Hmm, depending on the config it goes away.

Lets hold off on this for a little while so understand exactly what's going on.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

One might think "gee, it's trivial, just slam it in", but these nested includes are often not-trivial and something else can explode as a result.

I'll do a git-bisect and see if I can find the patch that causes this breakage so we know what's going on.

eh, don't bother.

I think I'll poke around a little since it clearly has some config dependancy.

- k