The patch titled own header file for struct page has been added to the -mm tree. Its filename is own-header-file-for-struct-page.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: own header file for struct page From: Heiko Carstens <heiko.carstens@xxxxxxxxxx> This moves the definition of struct page from mm.h to its own header file page-struct.h. This is a prereq to fix SetPageUptodate which is broken on s390: #define SetPageUptodate(_page) do { struct page *__page = (_page); if (!test_and_set_bit(PG_uptodate, &__page->flags)) page_test_and_clear_dirty(_page); } while (0) _page gets used twice in this macro which can cause subtle bugs. Using __page for the page_test_and_clear_dirty call doesn't work since it causes yet another problem with the page_test_and_clear_dirty macro as well. In order to avoid all these problems caused by macros it seems to be a good idea to get rid of them and convert them to static inline functions. Because of header file include order it's necessary to have a seperate header file for the struct page definition. Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Signed-off-by: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/mm.h | 65 ------------------------------- include/linux/mmzone.h | 5 ++ include/linux/page-struct.h | 70 ++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 64 deletions(-) diff -puN include/linux/mm.h~own-header-file-for-struct-page include/linux/mm.h --- a/include/linux/mm.h~own-header-file-for-struct-page +++ a/include/linux/mm.h @@ -16,6 +16,7 @@ #include <linux/mutex.h> #include <linux/debug_locks.h> #include <linux/backing-dev.h> +#include <linux/page-struct.h> struct mempolicy; struct anon_vma; @@ -216,65 +217,6 @@ struct mmu_gather; struct inode; /* - * Each physical page in the system has a struct page associated with - * it to keep track of whatever it is we are using the page for at the - * moment. Note that we have no way to track which tasks are using - * a page, though if it is a pagecache page, rmap structures can tell us - * who is mapping it. - */ -struct page { - unsigned long flags; /* Atomic flags, some possibly - * updated asynchronously */ - atomic_t _count; /* Usage count, see below. */ - atomic_t _mapcount; /* Count of ptes mapped in mms, - * to show when page is mapped - * & limit reverse map searches. - */ - union { - struct { - unsigned long private; /* Mapping-private opaque data: - * usually used for buffer_heads - * if PagePrivate set; used for - * swp_entry_t if PageSwapCache; - * indicates order in the buddy - * system if PG_buddy is set. - */ - struct address_space *mapping; /* If low bit clear, points to - * inode address_space, or NULL. - * If page mapped as anonymous - * memory, low bit is set, and - * it points to anon_vma object: - * see PAGE_MAPPING_ANON below. - */ - }; -#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS - spinlock_t ptl; -#endif - }; - pgoff_t index; /* Our offset within mapping. */ - struct list_head lru; /* Pageout list, eg. active_list - * protected by zone->lru_lock ! - */ - /* - * On machines where all RAM is mapped into kernel address space, - * we can simply calculate the virtual address. On machines with - * highmem some memory is mapped into kernel virtual memory - * dynamically, so we need a place to store that address. - * Note that this field could be 16 bits on x86 ... ;) - * - * Architectures with slow multiplication can define - * WANT_PAGE_VIRTUAL in asm/page.h - */ -#if defined(WANT_PAGE_VIRTUAL) - void *virtual; /* Kernel virtual address (NULL if - not kmapped, ie. highmem) */ -#endif /* WANT_PAGE_VIRTUAL */ -}; - -#define page_private(page) ((page)->private) -#define set_page_private(page, v) ((page)->private = (v)) - -/* * FIXME: take this include out, include page-flags.h in * files which need it (119 of them) */ @@ -546,11 +488,6 @@ static inline void set_page_links(struct */ #include <linux/vmstat.h> -#ifndef CONFIG_DISCONTIGMEM -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ -extern struct page *mem_map; -#endif - static __always_inline void *lowmem_page_address(struct page *page) { return __va(page_to_pfn(page) << PAGE_SHIFT); diff -puN include/linux/mmzone.h~own-header-file-for-struct-page include/linux/mmzone.h --- a/include/linux/mmzone.h~own-header-file-for-struct-page +++ a/include/linux/mmzone.h @@ -314,6 +314,11 @@ struct node_active_region { }; #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ +#ifndef CONFIG_DISCONTIGMEM +/* The array of struct pages - for discontigmem use pgdat->lmem_map */ +extern struct page *mem_map; +#endif + /* * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM * (mostly NUMA machines?) to denote a higher-level memory zone than the diff -puN /dev/null include/linux/page-struct.h --- /dev/null +++ a/include/linux/page-struct.h @@ -0,0 +1,70 @@ +#ifndef _LINUX_PAGE_STRUCT_H +#define _LINUX_PAGE_STRUCT_H + +#include <linux/types.h> +#include <linux/threads.h> +#include <linux/list.h> +#include <linux/spinlock.h> + +struct address_space; + +/* + * Each physical page in the system has a struct page associated with + * it to keep track of whatever it is we are using the page for at the + * moment. Note that we have no way to track which tasks are using + * a page, though if it is a pagecache page, rmap structures can tell us + * who is mapping it. + */ +struct page { + unsigned long flags; /* Atomic flags, some possibly + * updated asynchronously */ + atomic_t _count; /* Usage count, see below. */ + atomic_t _mapcount; /* Count of ptes mapped in mms, + * to show when page is mapped + * & limit reverse map searches. + */ + union { + struct { + unsigned long private; /* Mapping-private opaque data: + * usually used for buffer_heads + * if PagePrivate set; used for + * swp_entry_t if PageSwapCache; + * indicates order in the buddy + * system if PG_buddy is set. + */ + struct address_space *mapping; /* If low bit clear, points to + * inode address_space, or NULL. + * If page mapped as anonymous + * memory, low bit is set, and + * it points to anon_vma object: + * see PAGE_MAPPING_ANON below. + */ + }; +#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS + spinlock_t ptl; +#endif + }; + pgoff_t index; /* Our offset within mapping. */ + struct list_head lru; /* Pageout list, eg. active_list + * protected by zone->lru_lock ! + */ + /* + * On machines where all RAM is mapped into kernel address space, + * we can simply calculate the virtual address. On machines with + * highmem some memory is mapped into kernel virtual memory + * dynamically, so we need a place to store that address. + * Note that this field could be 16 bits on x86 ... ;) + * + * Architectures with slow multiplication can define + * WANT_PAGE_VIRTUAL in asm/page.h + */ +#if defined(WANT_PAGE_VIRTUAL) + void *virtual; /* Kernel virtual address (NULL if + not kmapped, ie. highmem) */ +#endif /* WANT_PAGE_VIRTUAL */ +}; + +#define page_private(page) ((page)->private) +#define set_page_private(page, v) ((page)->private = (v)) + +#endif /* _LINUX_PAGE_STRUCT_H */ _ Patches currently in -mm which might be from heiko.carstens@xxxxxxxxxx are git-s390.patch fix-x86_64-mm-stacktrace-cleanup-s390.patch revert-x86_64-mm-lockdep-dont-force-framepointer.patch reduce-max_nr_zones-remove-display-of-counters-for-unconfigured-zones-s390-fix-fix.patch slab-respect-architecture-and-caller-mandated-alignment.patch bootmem-use-max_dma_address-instead-of-low32limit.patch own-header-file-for-struct-page.patch convert-s390-page-handling-macros-to-functions.patch s390-fix-cmm-kernel-thread-handling.patch make-touch_nmi_watchdog-imply-touch_softlockup_watchdog-on-fix.patch simplify-update_times-avoid-jiffies-jiffies_64-aliasing-problem-2.patch kill-wall_jiffies.patch introduce-kernel_execve.patch rename-the-provided-execve-functions-to-kernel_execve.patch provide-kernel_execve-on-all-architectures.patch provide-kernel_execve-on-all-architectures-fix.patch remove-the-use-of-_syscallx-macros-in-uml.patch sh64-remove-the-use-of-kernel-syscalls.patch remove-remaining-errno-and-__kernel_syscalls__-references.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html