For some time, there has been a problem of linux/swap.h using
page_cache_release and release_pages without declaring them by
including linux/pagemap.h. pagemap.h isn't included because that
breaks the sparc build.
The full details are in the next post, but the short story is that
sparc's pgtable.h includes linux/swap.h, creating a mm.h -> mm.h
recursion. The current tree breaks that recursion by removing the
swap.h -> pagemap.h inclusion. This breaks builds on a regular basis
(references also in the next post).
These patches propose to break the recursion instead by removing the
linux/pagemap.h -> linux/highmem.h inclusion. I'd like to know
whether there are any fundamental reasons that this include should be
preserved.
The reason for choosing this include is that pagemap.h doesn't use
anything exported by highmem.h. The downside is that a bunch of
things now need to include highmem.h. These are mostly filesystems,
plus a good amount of arch code and a few drivers. I would argue that
if you use something from a header, you should include it, regardless
of whether you already get the header indirectly, so this isn't too
much of a downside as far as I'm concerned.
The one thing I'm uncertain about is whether pagemap.h and highmem.h
have some basic relationship that implies that you can assume you get
highmem when you include pagemap.
The two patches that follow do the following:
remove highmem.h from pagemap.h and add includes of highmem.h
to a number of files that now need them
include pagemap.h in swap.h
These are for comment only, not for mainline, so there's no S-o-b
right yet.
At this point, I haven't confirmed that the following files, which use
stuff from highmem.h but don't include it, still build:
./arch/x86/kernel/crash_dump_64.c
./arch/frv/mm/fault.c
./arch/frv/mm/kmap.c
./arch/h8300/mm/kmap.c
./arch/ia64/kernel/crash_dump.c
./arch/m68k/mm/kmap.c
./arch/m68knommu/mm/kmap.c
./arch/powerpc/kernel/crash_dump.c
./arch/sh/kernel/crash_dump.c
./arch/xtensa/mm/pgtable.c
./drivers/block/ps3disk.c
./drivers/infiniband/hw/ipath/ipath_verbs.h
./drivers/mmc/host/at91_mci.c
./drivers/mmc/host/mmci.h
./drivers/mmc/host/mmc_spi.c
./drivers/s390/block/xpram.c
./drivers/s390/char/tape_34xx.c
./drivers/kvm/paging_tmpl.h
./fs/hfsplus/hfsplus_fs.h
./include/asm-arm/cacheflush.h
./include/asm-frv/pgtable.h
./include/asm-x86/kexec_32.h
./include/asm-x86/kexec_64.h
./include/asm-x86/pgtable_32.h
./include/asm-m68k/motorola_pgalloc.h
./include/asm-m68k/sun3_pgalloc.h
./include/asm-m68k/sun3_pgtable.h
./include/asm-mips/cacheflush.h
./include/asm-mips/page.h
./include/asm-parisc/cacheflush.h
./include/asm-powerpc/pgtable-ppc32.h
./include/asm-ppc/pgtable.h
./include/asm-s390/kexec.h
./include/asm-sh/kexec.h
./mm/migrate.c
Jeff
--
Work email - jdike at linux dot intel dot com
> These patches propose to break the recursion instead by removing the
> linux/pagemap.h -> linux/highmem.h inclusion. I'd like to know
> whether there are any fundamental reasons that this include should be
> preserved.
Not fundamental reasons, but these patches break the ia64 build for most
configs with:
In file included from kernel/futex.c:59:
include/asm/futex.h: In function `futex_atomic_op_inuser':
include/asm/futex.h:62: error: implicit declaration of function `pagefault_disable'
include/asm/futex.h:86: error: implicit declaration of function `pagefault_enable'
make[1]: *** [kernel/futex.o] Error 1
Adding an include of <linux/uaccess.h> to kernel/futex.c is sufficient (but
not necessarily right) to unbreak this.
A few configs also fail with:
mm/migrate.c: In function `migrate_page_copy':
mm/migrate.c:359: error: implicit declaration of function `copy_highpage'
make[1]: *** [mm/migrate.o] Error 1
Making mm/migrate.c include <linux/highmem.h> fixes this one.
-Tony
On Fri, Oct 26, 2007 at 01:38:12PM -0700, Luck, Tony wrote:
> Not fundamental reasons, but these patches break the ia64 build for most
> configs with:
>
> In file included from kernel/futex.c:59:
> include/asm/futex.h: In function `futex_atomic_op_inuser':
> include/asm/futex.h:62: error: implicit declaration of function `pagefault_disable'
> include/asm/futex.h:86: error: implicit declaration of function `pagefault_enable'
> make[1]: *** [kernel/futex.o] Error 1
>
> Adding an include of <linux/uaccess.h> to kernel/futex.c is sufficient (but
> not necessarily right) to unbreak this.
Yeah, I've been changing <asm/uaccess.h> to <linux/uaccess.h> for
these. Looks like I'll need to make a pass over all the futex.h's.
> A few configs also fail with:
> mm/migrate.c: In function `migrate_page_copy':
> mm/migrate.c:359: error: implicit declaration of function `copy_highpage'
> make[1]: *** [mm/migrate.o] Error 1
>
> Making mm/migrate.c include <linux/highmem.h> fixes this one.
Excellent, I hadn't yet figured out who used migrate.c.
Jeff
--
Work email - jdike at linux dot intel dot com