On Fri, Jun 20, 2014 at 02:14:16PM -0700, Andrew Morton wrote: > On Fri, 20 Jun 2014 10:09:27 +0800 kbuild test robot <fengguang.wu@xxxxxxxxx> wrote: > > > tree: git://git.cmpxchg.org/linux-mmotm.git master > > head: df25ba7db0775d87018e2cd92f26b9b087093840 > > commit: 8d72d7b20fab14a779df2f7ea7632d4ee223dfcc [130/230] mm: memcontrol: rewrite charge API > > config: make ARCH=m32r m32104ut_defconfig > > > > All error/warnings: > > > > mm/swap.c: In function 'lru_cache_add_active_or_unevictable': > > >> mm/swap.c:719:2: error: implicit declaration of function 'TestSetPageMlocked' [-Werror=implicit-function-declaration] > > cc1: some warnings being treated as errors > > > > vim +/TestSetPageMlocked +719 mm/swap.c > > > > 713 if (likely((vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) != VM_LOCKED)) { > > 714 SetPageActive(page); > > 715 lru_cache_add(page); > > 716 return; > > 717 } > > 718 > > > 719 if (!TestSetPageMlocked(page)) { > > 720 /* > > 721 * We use the irq-unsafe __mod_zone_page_stat because this > > 722 * counter is not modified from interrupt context, and the pte > > > > hm, I can't think of anything very smart here. > > --- a/mm/swap.c~mm-memcontrol-rewrite-charge-api-fix-2 > +++ a/mm/swap.c > @@ -716,6 +716,7 @@ void lru_cache_add_active_or_unevictable > return; > } > > +#ifdef CONFIG_MMU > if (!TestSetPageMlocked(page)) { > /* > * We use the irq-unsafe __mod_zone_page_stat because this > @@ -726,6 +727,7 @@ void lru_cache_add_active_or_unevictable > hpage_nr_pages(page)); > count_vm_event(UNEVICTABLE_PGMLOCKED); > } > +#else > add_page_to_unevictable_list(page); > } We can define TestSetPageMlocked() for !MMU configurations. I don't have a suitable toolchain available right now, so this is untested. --- >From 180329a8c7a92f9e840fc8c04848df1a4bf21485 Mon Sep 17 00:00:00 2001 From: Johannes Weiner <hannes@xxxxxxxxxxx> Date: Fri, 20 Jun 2014 17:33:57 -0400 Subject: [patch] mm: page-flags: clean up the page flag test, set, clear macros - PAGEFLAG_FALSE only defines TEST, make it define SET and CLEAR as well, analogous to PAGEFLAG. - Define TESTSETFLAG_FALSE, analogous to TESTSETFLAG. - Define TESTSCFLAG_FALSE, analogous to TESTSCFLAG - Make PG_mlocked accessors the same on both MMU and !MMU setups Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> --- include/linux/page-flags.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 3c545b48aeab..448955d86e3c 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -171,13 +171,12 @@ static inline int __TestClearPage##uname(struct page *page) \ #define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) -#define PAGEFLAG_FALSE(uname) \ -static inline int Page##uname(const struct page *page) \ - { return 0; } - #define TESTSCFLAG(uname, lname) \ TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) +#define TESTPAGEFLAG_FALSE(uname) \ +static inline int Page##uname(const struct page *page) { return 0; } + #define SETPAGEFLAG_NOOP(uname) \ static inline void SetPage##uname(struct page *page) { } @@ -187,12 +186,21 @@ static inline void ClearPage##uname(struct page *page) { } #define __CLEARPAGEFLAG_NOOP(uname) \ static inline void __ClearPage##uname(struct page *page) { } +#define TESTSETFLAG_FALSE(uname) \ +static inline int TestSetPage##uname(struct page *page) { return 0; } + #define TESTCLEARFLAG_FALSE(uname) \ static inline int TestClearPage##uname(struct page *page) { return 0; } #define __TESTCLEARFLAG_FALSE(uname) \ static inline int __TestClearPage##uname(struct page *page) { return 0; } +#define PAGEFLAG_FALSE(uname) TESTPAGEFLAG_FALSE(uname) \ + SETPAGEFLAG_NOOP(uname) CLEARPAGEFLAG_NOOP(uname) + +#define TESTSCFLAG_FALSE(uname) \ + TESTSETFLAG_FALSE(uname) TESTCLEARFLAG_FALSE(uname) + struct page; /* forward declaration */ TESTPAGEFLAG(Locked, locked) @@ -248,7 +256,6 @@ PAGEFLAG_FALSE(HighMem) PAGEFLAG(SwapCache, swapcache) #else PAGEFLAG_FALSE(SwapCache) - SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) #endif PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) @@ -258,8 +265,8 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) #else -PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) - TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) +PAGEFLAG_FALSE(Mlocked) __CLEARPAGEFLAG_NOOP(Mlocked) + TESTSCFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) #endif #ifdef CONFIG_ARCH_USES_PG_UNCACHED -- 2.0.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>